This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, November 20, 2012 1:19:14 PM(UTC)
Groups: Registered
Posts: 4
OCX v16 Access mdb.
I have mousewheel zoom working with the image centered, but would like to get the cursor's position and zoom centered on the cursor. Is there an example?
#2
Posted
:
Wednesday, November 21, 2012 7:07:37 AM(UTC)
Groups: Registered, Tech Support
Posts: 179
How exactly do you want the behavior? Do you want to zoom the entire bitmap but keep the point under the mouse cursor in its old position?
Or do you want to zoom a partial area, like a magnifying glass around the mouse cursor?
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.
#3
Posted
:
Monday, November 26, 2012 8:01:06 AM(UTC)
Groups: Registered
Posts: 4
Your first description is what I am after. I have the zoom rectangle working. Now I need zoom wheel with the entire bitmap zoomed at increments of mouse wheel spins, with the area of the image remaining under the cursor's position.
#4
Posted
:
Wednesday, November 28, 2012 7:25:54 AM(UTC)
Groups: Registered, Tech Support
Posts: 179
I used the following code in VB6 and it worked. Please try similar code in your application:
Dim xPos As Single, yPos As Single 'global variables
Private Sub Command1_Click()
LEAD1.Load "OCR1.TIF", 0, 0, 1
LEAD1.EnableMouseWheel = True
LEAD1.AutoScroll = False
End Sub
Private Sub LEAD1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
xPos = x
yPos = y
End Sub
Private Sub LEAD1_MouseWheel(ByVal nDelta As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
Dim factor As Double
If nDelta > 0 Then
factor = 0.9 * nDelta / 120
Else
factor = 1 / 0.9 * -nDelta / 120
End If
Dim xPos2, yPos2, w2, h2
xPos2 = (xPos * factor)
yPos2 = (yPos * factor)
w2 = (LEAD1.Width * factor)
h2 = (LEAD1.Height * factor)
LEAD1.ZoomToRect _
(xPos - xPos2) / Screen.TwipsPerPixelX, _
(yPos - yPos2) / Screen.TwipsPerPixelY, _
w2 / Screen.TwipsPerPixelX, _
h2 / Screen.TwipsPerPixelY
End Sub
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.
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.