Hier das Beispiel:
Code: Alles auswählen
If OpenWindow(0, 0, 0, 200, 200, "2DDrawing Beispiel", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If CreateImage(0, 200, 200) And StartDrawing(ImageOutput(0))
Box(0, 0, 200, 200, RGB(255, 255, 255))
For Width = 1 To 180 Step 5
Line(10, 10, Width, 180, RGB(Random(255), Random(255), Random(255)))
Next Width
StopDrawing()
ImageGadget(0, 0, 0, 200, 200, ImageID(0))
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
