gosonic
asked on
What unit of measurement is involved here?
vb.net 2003
I am using x= IE.Document.documentElemen t.scrollTo p
What unit of measurement does x represent and how do I convert that into something that equals pixels?
Example:
if I move the scrollbar down 1 pixel x = 2
if I move the scrollbar down 2 pixels x = 5
if I move the scrollbar down 3 pixels x = 7
if I move the scrollbar down 10 pixels x = 24
Thanks
I am using x= IE.Document.documentElemen
What unit of measurement does x represent and how do I convert that into something that equals pixels?
Example:
if I move the scrollbar down 1 pixel x = 2
if I move the scrollbar down 2 pixels x = 5
if I move the scrollbar down 3 pixels x = 7
if I move the scrollbar down 10 pixels x = 24
Thanks
The units are pixels. You seem to be moving the scrollbar by two or three pixels at a time.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ozo - I double checked. Only 1 pixel at a time.
AlexFM
I agree that seems to be the case. To add to the problem when I change monitors x changes also.
Example on a 17 inch display a 100 pixel movement sets x to 229 on a 19 inch display a 100 pixel movement sets x to 293. Both set at (1024x768) Go figure, you would think there would be something useful here with IE.Document.documentElemen t.scrollTo p. but I can't find it, yet.
AlexFM
I agree that seems to be the case. To add to the problem when I change monitors x changes also.
Example on a 17 inch display a 100 pixel movement sets x to 229 on a 19 inch display a 100 pixel movement sets x to 293. Both set at (1024x768) Go figure, you would think there would be something useful here with IE.Document.documentElemen
Many graphics programs work with images using their actual size in mm, inches etc. In .NET you can see Graphics.DpiX and Graphics.DpiY properties. IE doesn't use it but it uses unmanaged API which does the same. Now suppose you have some image whith known pixel size (for example, 1 pixel = 1 mm), and you want to draw it with it's actual size. This is the place for floating-point calculations and setting scroll range. The same may apply to fonts - let's say you want to draw text with 2 mm height on any monitor with any screen resolution.
ASKER
I gave the Graphics.DpiX a try and can't find any relief there either. Thanks for all you insight, I going to go to work on a work around - thanks again.