Linienstärke festlegen für Circle usw?
Verfasst: 11.01.2010 18:51
Wie legt man in 2D bei Purebasic die Linienstärken fest?
Danke.
Danke.
Das deutsche PureBasic-Forum
https://www.purebasic.fr/german/
Code: Alles auswählen
Global PS.PAINTSTRUCT
Global x_Left = 100
Global x_Right = 300
Global y_Top = 100
Global y_Bottom = 300
Global Strichstaerke = 10
Global Color = $FF
Global hwnd
Global hdc
Global hpen
Procedure Paint_Ellipse(x_Left, y_Top, x_Right, y_Bottom)
hdc = BeginPaint_(hwnd, @PS)
hpen = CreatePen_(#PS_SOLID, Strichstaerke, Color)
hso = SelectObject_(hdc, hpen)
Ellipse_(hdc, x_Left, y_Top, x_Right, y_Bottom)
EndPaint_(hwnd, @PS)
DeleteObject_(hso)
EndProcedure
hwnd = OpenWindow(0, 0, 0, 400, 400, "API-Paint", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If hwnd
Paint_Ellipse(x_Left, y_Top, x_Right, y_Bottom)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf