Link to home
Start Free TrialLog in
Avatar of Torus
Torus

asked on

TwipsPerPixel Question

I really don't understand that why the Screen.TwipsPerPixelX value is always a constant and Screen.TwipsPerPixelY is O when I moved the mouse to the SystemTray icon. No matter how I changed the resolution, the values haven't changed. I have no concept about it. Also, what is the different between ppi and dpi, any relationship? Moreover, How many pixels represent 1 physical inch? The value will varies with the screen resolution? VB6 has any function to convert between twips, points, pixels and Inches??

Thanks in advance    
Avatar of OeilNoir
OeilNoir

Screen size and resolution will affect the number of pixels per inch.
Exemple : if you have a 14 inch monitor and you set your screen in 800X600, you will
have a height of 800 pixel.. if you change it  to 640X480, you will have a height of 480 and your monitor size haven't changed. only the number of pixel changed.

There is about 1440 Twips per inch
There is about 72 points per inch
15 twpis = 1 pixel
(see "ScaleMode" in your VB help)

i think the reason why TwipsPerPixelY is always 0 when you move over the System Tray icon, is because you wrote the code somewhere in mouse_move.. and since you move
outside your form it can't tell the value..

what are you trying to do exactly?

Try setting 'Large Font'. Screen.TwipsPerPixelY will change.
Avatar of Torus

ASKER

Actually I just want to calculate the actually printer size of a picture via twips or pixels.
Also I have no concept about what they are and I want to know more about it.

As you said, 15twips = 1 pixels. Is it a constant no matter what resolution. If so, I don't understand that if 1440 twips per inch, the number of  pixels per inch should have no change even resolution is changed?
Also what is different between ppi and dpi? What does point mean? How many pixels
represent one point?

Thanks in advance


ASKER CERTIFIED SOLUTION
Avatar of Tommy Hui
Tommy Hui

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't have much idea about the units.  But you can convert from one to another usin ScaleX and ScaleY functions.