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 : Thursday, March 17, 2005 10:32:57 AM(UTC)

john  
john

Groups: Registered
Posts: 4


how can I center a zoom on a clicked location?  I know this has been asked before.  But I didn't see a good answer for it.  I am using VB for developing.  I am capturing the x,y coordinates in the mouse down event and trying to use them to center the image.  Any help out there?
 

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, August 2, 2006 7:22:00 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

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

Please add the following code lines to your project to be able to  zoom on a clicked location:

Private Sub LEAD1_MouseDown (Button As Integer, Shift As Integer, x As Single, y As Single)

LEAD1.ScaleMode = 3
Dim xPixels, yPixels, newWidth, newHeight
xPixels = x / Screen.TwipsPerPixelX
yPixels = y / Screen.TwipsPerPixelY
newWidth = LEAD1.ScaleWidth - 60
newHeight = LEAD1.ScaleHeight - 60
LEAD1.ZoomToRect xPixels - newWidth / 2, yPixels - newHeight / 2, newWidth, newHeight

End Sub
 
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.211 seconds.