hello and welcome to my 1,000,000 $ question....be the first to answer and win 1,000,000 $ (virtually of course :sign0147
that's the issue:
I have a form, with an image 1500x500 streched. I'm using ImageScroller from Byak@ and i wrote an easy function to zoom in/out the image (basically add more pixel to the streched image).
Well, I'd like to make the zoom scrolling the image to the same point at the centre of the screen, so the new zoomed image has the same view centered as the 1:1 image.
here is the code for explain better; under the code i've linked a pic to show better what i need.
The grey part is the one i get right now, but i want to get the centered part (what a wonderful nose, uh? ).
Any help will be muuuuuch appreciated thanks as always in advance! :sign0060:
-Europe
that's the issue:
I have a form, with an image 1500x500 streched. I'm using ImageScroller from Byak@ and i wrote an easy function to zoom in/out the image (basically add more pixel to the streched image).
Well, I'd like to make the zoom scrolling the image to the same point at the centre of the screen, so the new zoomed image has the same view centered as the 1:1 image.
here is the code for explain better; under the code i've linked a pic to show better what i need.
B4X:
Sub dzem_MagicEvent ' -----> Byak@ SCROLL IMAGE
If down=1 Then
Dim LowWord, HighWord, X, Y
LowWord = bit.OR2(dzem.lParam, 4294901760)
X = bit.XOR2(LowWord, 4294901760)
HighWord = bit.OR2(dzem.lParam, 65535)
Y = bit.XOR2(HighWord, 65535)/2^16
Img.Left = Img.Left - (DownX - X)
Img.Top = Img.Top - (DownY - Y)
End If
End Sub
Sub zoominbtn_Click ' ------> ZOOM IN FUNCTION
If zoom < 3 AND zoom >= -3 Then
Img.Width = Img.Width + 200
Img.Height = Img.Height + 100
Img.Left = Img.Left - ' WHICH VALUE!?!?
Img.Top = Img.Top - ' WHICH VALUE!?!?
zoom=zoom+1
End If
End Sub
Sub zoomoutbtn_Click ' ------> ZOOM IN FUNCTION
If zoom <= 3 AND zoom > -3 Then
Img.Width = Img.Width - 200
Img.Height = Img.Height - 100
Img.Left = Img.Left + ' WHICH VALUE!?!?
Img.Top = Img.Top + ' WHICH VALUE!?!?
zoom=zoom-1
End If
End Sub
The grey part is the one i get right now, but i want to get the centered part (what a wonderful nose, uh? ).
Any help will be muuuuuch appreciated thanks as always in advance! :sign0060:
-Europe
Last edited: