Here we paint a blue rounded rectangle on the bitmap, which is
auto sized. We also set the size of the corners to 32 pixels - the
default is 16.
Note that the bitmap size is set to 250x250 because we center
the image (25 + 200 + 25 = 250). Size the bitmap manually if this
is not what you want.
[C#]
using (Bitmap bm = new Bitmap(500, 500)) {
using (Graphics gr = Graphics.FromImage(bm))
gr.FillRoundRectangle(Brushes.Blue, new RectangleF(50, 50, 400, 400), new SizeF(64, 64));
bm.Save(Server.MapPath("IG8_Graphics_FillRoundRectangle.png"));
}

IG8_Graphics_FillRoundRectangle.png
|