Smooth round corners

smiles

Well-known member
Joined
May 21, 2008
Messages
47
Programming Experience
Beginner
I use these code to draw a rectangle but with round corners
VB.NET:
        q.StartFigure()
        q.AddArc(30, 50, 25, 25, 180, 90)
        q.AddLine(55, 50, 300, 50)
        q.AddArc(300, 50, 25, 25, 270, 90)
        q.AddLine(325, 75, 325, 100)
        q.AddArc(300, 100, 25, 25, 0, 90)
        q.AddLine(300, 125, 55, 125)
        q.AddArc(30, 100, 25, 25, 90, 90)
        q.CloseFigure()
        e.Graphics.FillPath(Brushes.Blue, q)
but as you see in the attached image, the corner is rough :eek:
could you give me some way to solve it, thanks so much !!!
 

Attachments

  • untitled.JPG
    untitled.JPG
    3.8 KB · Views: 58
Look into the member list of Graphics class in help, there are several properties (5-6 or so) you can set that changes various graphics quality settings. Try these with the e.Graphics instance.
 
Look into the member list of Graphics class in help, there are several properties (5-6 or so) you can set that changes various graphics quality settings. Try these with the e.Graphics instance.
VB.NET:
e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
Thanks so much ;)
 
Back
Top