Re: TwipsPerPixel
"Stewart McMahon" <smm@xxxxxxxxxxxxxx> wrote in message
news:%23vxBRYmkIHA.5396@xxxxxxxxxxxxxxxxxxxxxxx
How can I change the TwipsPerPixel under XP, please?
.. . . by the way, just in case you are wondering why the Windows settings
mention dpi (pixels per inch) when you asked about twips per pixel it is
just that twips and inches have a defined and fixed relationship to each
other, so the same thing can be said in more than one way. There are in fact
1440 twips in one inch, so a machine that has 96 pixels per inch also has
1440/96 twips per pixel (15 twips per pixel). Try the following code as an
example. Run it first before you make the switch and then run it again
afterwards:
Private Sub Command1_Click()
MsgBox Me.ScaleX(1, vbInches, vbPixels) & _
" pixels per inch." & vbCrLf & _
Me.ScaleX(1, vbPixels, vbTwips) & _
" twips per pixel."
End Sub
Mike
.
Relevant Pages
- Re: Picture in image control gets cliped "Sometimes" does not stay
... the width of the picture in the Image control. ... per logical inch (the equivalent of 15 twips per pixel) whereas others run ... exactly the same "twip size" as the design time twip size client area on ... (microsoft.public.vb.general.discussion) - Re: Picture in image control gets cliped "Sometimes" does not stay flu
... the width of the picture in the Image control. ... This will almost certainly be because your code is not properly taking into acount the differences in the Windows dots per inch (or twips per pixel) setting on different machines. ... The only time it will fail to do this is if the pixel size of the display on which your code is running is not sufficient to display such a Form, in which case it will make the client area as large as it can under the circumstances. ... (microsoft.public.vb.general.discussion) - Re: Why back groud image becomes smaller?
... When VB loads your Form it looks at the number of "twips per pixel" on whatever machine your code is currently running and it looks in the exe file at the "twip size" you set at design time for the Form and its controls. ... Therefore, if the number of "twips per pixel" (or, alternatively, the number of "pixels per inch") on the machine on which your exe is currently running is different than the "twips per pixel" on your development machine then the pixel size of the Form will be different. ... (microsoft.public.vb.general.discussion) - Re: Clip capture - thanks Mike!
... >some things is default vbPixels. ... >>> make sense if the smallest division is Pixel. ... as so it follows that there are 1440 twips in one inch. ... >> by the pixel resolution of the display. ... (comp.lang.basic.visual.misc) - Re: form size suddenly not correct
... > I recently updated my ATI Radeon 9200 video driver and ... your Forms to always be a fixed pixel size I ... stores the desired size using Twips as the unit of measurement (both in your ... ..frm files and in your compiled exe file), and it do so regardless of the ... (comp.lang.basic.visual.misc) |
|