Objekt runde Ecken pixelig

  • VB.NET

Es gibt 3 Antworten in diesem Thema. Der letzte Beitrag () ist von AliveDevil.

    Objekt runde Ecken pixelig

    Hey Leute

    wenn ich jetzt mit diesem code ein Objekt runde Ecken gebe werden diese runde ecken pixelig und nicht sauber rund.

    VB.NET-Quellcode

    1. Module Module1
    2. Sub rundeck(ByVal was As Object, _
    3. ByVal x As Integer, ByVal y As Integer, _
    4. ByVal width As Integer, ByVal height As Integer, _
    5. ByVal radius As Integer)
    6. Dim gp As System.Drawing.Drawing2D.GraphicsPath = _
    7. New System.Drawing.Drawing2D.GraphicsPath()
    8. gp.AddLine(x + radius, y, x + width - radius, y)
    9. gp.AddArc(x + width - radius, y, radius, radius, 270, 90)
    10. gp.AddLine(x + width, y + radius, x + width, y + height - radius)
    11. gp.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90)
    12. gp.AddLine(x + width - radius, y + height, x + radius, y + height)
    13. gp.AddArc(x, y + height - radius, radius, radius, 90, 90)
    14. gp.AddLine(x, y + height - radius, x, y + radius)
    15. gp.AddArc(x, y, radius, radius, 180, 90)
    16. gp.CloseFigure()
    17. was.region = New System.Drawing.Region(gp)
    18. gp.Dispose()
    19. End Sub
    20. End Module


    VB.NET-Quellcode

    1. rundeck(Me, 0, 0, Me.Width, Me.Height, 30)


    gibt es eine möglichkeit dies zu verbessern oder gibt es noch einen anderen weg?
    Stell Dir vor, Du musst auf Millimeterpapier einen Kreis malen, darfst aber nur ganze Kästchen ausmalen.
    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    Programmierfragen über PN / Konversation werden ignoriert!