Code: Alles auswählen
#Window = 0
#Gadget = 1
If OpenWindow(#Window, 0, 0, 200, 200, "2DDrawing Beispiel", #PB_Window_SystemMenu|#PB_Window_Tool|#PB_Window_ScreenCentered)
CanvasGadget(#Gadget, 10, 10, 180, 180)
If StartVectorDrawing(CanvasVectorOutput(#Gadget))
; Draw::aLineXY(90, 90, 90 + 80 * Cos(Radian(230)), 90 + 80 * Sin(Radian(230)), $228B22, Draw::#DPI)
MovePathCursor(90, 90)
AddPathLine(90 + 80 * Cos(Radian(230)), 90 + 80 * Sin(Radian(230)))
VectorSourceColor($FF228B22)
StrokePath(1)
; Draw::aCircleSector(90, 90, 70, 40, 90, $800000, $00D7FF, Draw::#DPI)
MovePathCursor(90, 90)
AddPathCircle(90, 90, 70, 40, 90, #PB_Path_Connected)
ClosePath()
VectorSourceColor($FF00D7FF)
FillPath(#PB_Path_Preserve)
VectorSourceColor($FF800000)
StrokePath(1)
; Draw::aCircle(90, 90, 80, $800000, Draw::#DPI)
AddPathCircle(90, 90, 80)
VectorSourceColor($FF800000)
StrokePath(1)
; Draw::aCircleArc(90, 90, 70, 250, 340, $008CFF, Draw::#DPI)
AddPathCircle(90, 90, 70, 250, 340)
VectorSourceColor($FF008CFF)
StrokePath(1)
; Draw::aLine(10, 90, 160, 1, $8515C7, Draw::#DPI)
MovePathCursor(10, 90)
AddPathLine(160, 0, #PB_Path_Relative)
VectorSourceColor($FF8515C7)
StrokePath(1)
; Draw::aBox(5, 5, 170, 170, $CD0000, Draw::#DPI)
AddPathBox(5, 5, 170, 170)
VectorSourceColor($FFCD0000)
StrokePath(1)
StopVectorDrawing()
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf