blitzplus example (using a canvas)
app=CreateWindow("image scroll example",32,32,384,384)
canvas=CreateCanvas(0,0,320,320,app)
; prepare some image ..
image=CreateImage(800,800)
SetBuffer ImageBuffer(image)
For t=0 To 100
r=Rnd(0,255)
g=Rnd(0,255)
b=Rnd(0,255)
Color r,g,b
Rect Rnd(0,800),Rnd(0,800),64,64,True
Color b,r,g
Oval Rnd(0,800),Rnd(0,800),64,64,True
Next
quit=False
SetBuffer CanvasBuffer(canvas)
Repeat
WaitEvent()
If EventID()=$803 quit=True; alt f4 = quit
If KeyDown(200) ; up
y=y-4
EndIf
If KeyDown(208) ; down
y=y+4
EndIf
If KeyDown(203) ; left
x=x-4
EndIf
If KeyDown(205) ; right
x=x+4
EndIf
DrawImage image,x,y
FlipCanvas canvas:Cls
Until quit
FreeImage image
FreeGadget app
End
|