PVGadgets_Canvas (CanvasID,ImageId,x,y,w,h,BColor)

Top  Previous  Next

Creates a Canvas Gadget for you to Draw with.

 

Use:

PVGadgets_Canvas(#Gadget,#Image,10,10,200,200,$EEEEEE)

 

 

Returns 0 if Failed

 

 

 

BColor

$0 - $FFFFFF (RGB Background Color Value)

 

 

 

Example:

 

#Window_Main=1

 

#Gadget_Main_Canvas=2

#Image_Main_Canvas=2

 

 

If OpenWindow(#Window_Main,175,0,184,172,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Demo")

If CreateGadgetList(WindowID(#Window_Main))

PVGadgets_Canvas(#Gadget_Main_Canvas,#Image_Main_Canvas,15,25,150,100,$EEEEEE)

 

UseImage(#Image_Main_Canvas)

StartDrawing(ImageOutput())

Circle(50,50,50,$FF0000)

Box(60,60,70,30,$0000FF)

StopDrawing()

PVGadgets_Refresh(#Gadget_Main_Canvas)

 

Repeat

Until WaitWindowEvent()=#PB_Event_CloseWindow

 

EndIf

EndIf