Hallo,
wie kann man ein Path mit zwei Farben zeichnen? Also allgemein wäre das ja kein Problem, jedoch zeichne ich runde ecken. Undzwar so:
Gibt es ne Möglichkeit? Also ich will den Button szs. zu 50 % mit R(240)G(240)G(240) und weiss füllen.
Grüße
wie kann man ein Path mit zwei Farben zeichnen? Also allgemein wäre das ja kein Problem, jedoch zeichne ich runde ecken. Undzwar so:
VB.NET-Quellcode
- Private Function BorderRadius(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal radius As Integer) As GraphicsPath
- Dim gp As GraphicsPath = New GraphicsPath()
- gp.AddLine(x + radius, y, x + width - radius, y)
- gp.AddArc(x + width - radius, y, radius, radius, 270, 90)
- gp.AddLine(x + width, y + radius, x + width, y + height - radius)
- gp.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90)
- gp.AddLine(x + width - radius, y + height, x + radius, y + height)
- gp.AddArc(x, y + height - radius, radius, radius, 90, 90)
- gp.AddLine(x, y + height - radius, x, y + radius)
- gp.AddArc(x, y, radius, radius, 180, 90)
- gp.CloseFigure()
- 'gp.Dispose()
- Return gp
- End Function
Gibt es ne Möglichkeit? Also ich will den Button szs. zu 50 % mit R(240)G(240)G(240) und weiss füllen.
Grüße