Painting a triangle with GDI
Posted: Mon Nov 02, 2020 9:50 pm
Hi,
i found this code on the board but it doesn't work anymore (no error, no result on the screen):
Has the GDI changed in the meantime or something?
Thanks!
i found this code on the board but it doesn't work anymore (no error, no result on the screen):
Code: Select all
Procedure Triangle(hdc,x1.l, y1.l, x2.l, y2.l, x3.l, y3.l)
ProcedureReturn Polygon_(hdc, @x1, 3)
EndProcedure
OpenWindow(0, 0, 0, 320, 240, "Triangle", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
Repeat
hdc = StartDrawing( WindowOutput(0) )
If hdc
FrontColor(RGB(255, 0, 0))
Triangle(hdc,10, 10, 10, 100, 100, 10)
; Polygon_(hdc, @x1, 3)
StopDrawing()
EndIf
Until WaitWindowEvent() = #PB_Event_CloseWindow
Thanks!