VBGamer |
|
Re: URGENT RESPONCE ian (0 replies, 0 views) (2001-Mar-30) The FASTEST way to do this using only VB is to:
1. at the start of your app, assign the value of Screen.TwipsPerPixelX to a module level variable (TwipX as Single) of type SINGLE,
and do the same for Screen.TwipsPerPixelY (TwipY as Single)
2. when you need it, use : ResultX = InputValueX / TwipX
(substitute TwipY for Y axis calcs).
This method is 12x faster than using the ScaleX() method of the Form object, and 5x faster than using the Screen.TwipsPerPixel value directly in a call. This is due to the fact that both the ScaleX Method call and Screen.TwipsPerPixel Property are COM calls, combined with VB's already slow pace and extravegant type and error checking, making them incredibly slow. |