How to draw rectangle with rounded corners

is there a way to draw rectangles with rounded corners?

@dileepawijay,

We will look into it but could you please share a sample image having your desired rectangle with rounded corners. This will help to evaluate your requirements precisely.

looking to create round rectangles as below

image.png (49.8 KB)

@dileepawijay,

Thanks for the image file.

We will evaluate your requirements to draw rectangle with rounded corners. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): DRAWINGNET-1258

You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@dileepawijay,

You can set myPen.LineJoin = LineJoin.Round and draw a rectangle with path like this:

using Aspose.Drawing;
using System;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace ConsoleAppW
{
    class Program
    {
        static void Main(string[] args)
        {
            License oLic = new License();
            oLic.SetLicense("Aspose.Drawing.NET.lic");

            Bitmap oImage = new Bitmap(100, 100);
            Graphics g = Graphics.FromImage(oImage);
            g.SmoothingMode = SmoothingMode.HighQuality;
            g.Clear(Color.White);

            Pen myPen = new Pen(Brushes.Red, 12);
            myPen.LineJoin = LineJoin.Round;

            GraphicsPath oPath = new GraphicsPath();
            oPath.AddRectangle(new Rectangle(10, 10, 80, 80));
            g.DrawPath(myPen, oPath);

            oImage.Save(@"dw.png");
        }
    }
}

dw.png (288 Bytes)

Let us know if you still have any issue.