Es wird im CanvasGadget nur eine waagerechte Linie gezeichnet von 0,0 - 200,0.
Es sollen aber 3 Linienzüge werden. Wo liegt bitte der Fehler.
Danke.
Gruss
Code: Alles auswählen
Global hdc.l,poly.l
*poly=AllocateMemory(24)
PokeL(*poly,10)
PokeL(*poly+4,10)
PokeL(*poly+8,100)
PokeL(*poly+12,150)
PokeL(*poly+16,190)
PokeL(*poly+20,100)
Declare asm_polyline()
If OpenWindow(0, 0, 0, 220, 220, "CanvasGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 10, 10, 200, 200)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Gadget And EventGadget() = 0
If EventType() = #PB_EventType_LeftButtonDown
hdc = StartDrawing(CanvasOutput(0))
asm_polyline()
StopDrawing()
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
EndIf
Procedure asm_polyline()
Polyline_(hdc,@poly,3)
EndProcedure