Seite 1 von 1

Linienstärke festlegen für Circle usw?

Verfasst: 11.01.2010 18:51
von funkheld
Wie legt man in 2D bei Purebasic die Linienstärken fest?

Danke.

Re: Linienstärke festlegen für Circle usw?

Verfasst: 11.01.2010 19:00
von Kaeru Gaman
die Funktionalität ist nicht drin.

Ich hab vor längerem mal ne API-Lösung gesehen, aber seit 4.40 ist die Drawing-Lib brandneu und selbstgestrickt, ich bezweifle, dass das überhaupt vorgesehen ist die Linienstärke zu verändern.

Re: Linienstärke festlegen für Circle usw?

Verfasst: 11.01.2010 20:35
von Helle
Hier ein API-Beispiel für Kreis/Ellipse:

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
Gruß
Helle

Re: Linienstärke festlegen für Circle usw?

Verfasst: 11.01.2010 20:54
von funkheld
Jup, danke.

Ich wollte mich aber nur innerhalb der Grafikbefehle von Purebasic bewegen und nicht noch API reinbringen, weil die API-Grafikbefehle doch recht langsam sind,