Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, August 9, 2006 7:06:31 AM(UTC)

Travis  
Travis

Groups: Registered, Tech Support
Posts: 207

Was thanked: 3 time(s) in 3 post(s)

For each Mouse event (MouseMove, MouseDown, MouseUp, etc) we have the following documented for the X and Y parameters: The unit of measure is determined by the form that contains the Main Control. 

However, if you actually try and process these events you'll notice that no matter what ScaleMode you set the Form, the values are always give in Twips.  This is due to a flaw in Visual Basic 6.0.

A workaround for this issue is to divide each value by Screen.TwipsPerPixelX and Screen.TwipsPerPixelY.

For example....you would change your code from

    ClientX = x
    ClientY = y
to:
    ClientX = x / Screen.TwipsPerPixelX
    ClientY = y / Screen.TwipsPerPixelY

This will give you client coordinates in pixels.

Travis Montgomery
Senior Sales Engineer
LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, January 9, 2008 12:45:19 AM(UTC)

jam  
jam

Groups: Registered
Posts: 7


hi...

i just like to know... how do i get the x and y coordinates of the image inside the Lead1. Ive also tried the example above but ive found out that when the image width and height is greater than the width and height of lead1...when you scroll down to the bottom of an image its only display the same x and y coordinates eventhough the your pointing to the heighest value of the image....

for example the
Image info:
infoWidth=1039 and InfoHeight=335
Lead1 control:
Lead1 width=500
Lead1 Height=200

when you point the mouse the last of the control width and the image value is 1039
x value is still 500..

any HELP?
 
#3 Posted : Wednesday, January 9, 2008 4:55:25 AM(UTC)

BoydP  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Use the function ClientToBitmap of the Main Control and pass in the X and Y values you wish you translate to bitmap coordinates.  The resulting values will be stored in the ConvertX and ConvertY properties of the Main Control.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.066 seconds.