Hi. I want to do a selection box on a canvas but the Rect end coords dont seem to work properly. Can anyone help?
AppTitle "test"
mainWin = CreateWindow("test", 0, 0, 700, 500, 0, 9)
imageCan = CreateCanvas(20, 20, 300, 300, mainWin)
SetBuffer CanvasBuffer(imageCan)
While WaitEvent() <> $803
If EventID() = $203
SetStatusText mainWin, EventX() + "," + EventY()
End If
If EventID() = $201
mx = EventX()
my = EventY()
While WaitEvent()
If EventID() = $203
Cls
Rect mx, my, EventX(), EventY()
FlipCanvas imageCan
End If
If EventID() = $202
Exit
End If
Wend
End If
Wend
|