Code: Select all
Procedure Draw(x, y)
If StartVectorDrawing(CanvasVectorOutput(0))
Debug x
Debug y
AddPathBox(x, y, ImageWidth(0), ImageHeight(0))
VectorSourceImage(ImageID(0), 255, ImageWidth(0), ImageHeight(0))
FillPath()
StopVectorDrawing()
EndIf
EndProcedure
If OpenWindow(0, 0, 0, 400, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 400, 200)
LoadImage(0, #PB_Compiler_Home + "examples/Sources/Data/PureBasicLogo.bmp")
AddWindowTimer(0, 1, 55)
Repeat
Event = WaitWindowEvent()
Select event
Case #PB_Event_Timer
x+1
y+1
Draw(x, y)
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf