Just to clearify a bit more, I made a app just to test moving a large
image, its just an empty maximized form, with double buffering on.
code:
Dim blnMouseDown As Boolean = False
Dim curX As Long = 0
Dim curY As Long = 0
Dim isX As Long = 0
Dim isY As Long = 0
Dim curPX As Long = 0
Dim curPY As Long = 0
Dim wasPX As Long = 0
Dim wasPY As Long = 0
Dim blnFirstLoad As Boolean = True
Dim myBMP As New _
System.Drawing.Bitmap("C:\a.jpg")
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Load
blnMouseDown = True
Me.Invalidate()
blnMouseDown = False
End Sub
Private Sub MyMouseMove(ByVal sender As Object, ByVal e _
As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
isX = e.X
isY = e.Y
If blnMouseDown Then
Me.Invalidate()
End If
End Sub
Private Sub MyMouseUp(ByVal sender As Object, ByVal e _
As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
blnMouseDown = False
wasPX = curPX
wasPY = curPY
End Sub
Private Sub MyMouseDown(ByVal sender As Object, ByVal e _
As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
curX = e.X
curY = e.Y
blnMouseDown = True
End Sub
Private Sub MyPaint(ByVal sender As Object, ByVal e _
As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
If blnMouseDown = True Or blnFirstLoad = True Then
curPX = wasPX + isX - curX
curPY = wasPY + isY - curY
e.Graphics.DrawImageUnscaled(myBMP, curPX, curPY)
End If
End Sub
Again, im just using this to test moving a large image. The image size
is 2560x1600, my screen res is 1920x1200. And when moving this image
around its pretty choppy... Which is why I wanted to try using BitBlt
instead of .DrawImage.
If anyone knows how to get smoother movement tho, i'd appreciate the
help.