Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Twerps to Pixel conversion

Status
Not open for further replies.

JohnStep

Programmer
Apr 19, 2000
190
US
<br>&nbsp;&nbsp;Does anyone know the twerps to pixel conversion. I know 1440 Twerps = 1 Inch, but how many pixels is that??<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thanks in Advance<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;John Stephens
 
use Screen.TwipsPerPixelX and Screen.TwipsPerPixelY<br>or in the properties listing, type in a Twip, then change scalemode to Pixel, and look at the height, width in the properties window again. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
John,<br><br>It's not usually very useful to say how many pixels per inch - because that changes with the screen resolution - so a screen working at a resolution of 800x600 has fewer pixels per inch than one running at 1024x768. And that's why you have twips - they are a way of sizing screen objects without having to worry about what resolution your users screen is running at.<br><br>The two Screen properties, that Karl mentions, (<FONT FACE=monospace><b>Screen.TwipsPerPixelX</font></b> and <FONT FACE=monospace><b>Screen.TwipsPerPixelY</font></b>) are the key.<br><br>If you set <FONT FACE=monospace><b>Form1.Height = Screen.TwipsPerPixelY / 2</font></b> and <FONT FACE=monospace><b>Form1.Width = Screen.TwipsPerPixelX / 2</font></b> the form will always be half the size of the screen - no matter what resolution the screen is running at.<br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>Please -- Don't send me email questions without posting them in Tek-Tips as well. Better yet -- Post the question in Tek-Tips and send me a note saying "Have a look at so-and-so in the thingy forum would you?"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top