Sub Globals
Dim x1,y1
Dim maxX,maxY
End Sub
Sub App_Start
Form1.Show
drawer.New1("form1",false)
bmpMap.New1("pic.jpg") 'Loads the image to a Bitmap object
rectDest.New1(5,5,form1.Width-10,form1.Height-10) 'The form's rectangle
rectSrc.New1(0,0,rectDest.Width,rectDest.Height) 'The bitmap's rectangle
maxX = bmpMap.Width - rectDest.Width
maxY = bmpMap.Height - rectDest.Height
DrawMap
End Sub
Sub Form1_MouseDown (x,y)
x1 = x
y1 = y
End Sub
Sub Form1_MouseUp (x,y)
RectSrc.X = Min(maxX,Max(RectSrc.X - x + x1,0)) 'Checks the bounds and updates the coordinates
RectSrc.Y = Min(maxY,Max(RectSrc.Y - y + y1,0))
DrawMap
End Sub
Sub DrawMap
drawer.DrawImage1(bmpMap.Value,rectSrc.Value,rectDest.Value,false)
drawer.Refresh2(rectDest.Value)
End Sub