This is a little function I've built that return an image of a round corner - by selecting the border color and the fill color, the nice thing is you can use it to generate a rounded corner on the fly in your web site, it's pretty fast!
public static Bitmap RoundedCorner(ContentAlignment position ,int height, int width, Color border, Color fill)
{
Bitmap myBmpImage = new Bitmap(1, 1);
// Create the graphics object
Graphics myGraphics = Graphics.FromImage(myBmpImage);
myBmpImage = new Bitmap(myBmpImage, new Size(width, height));
myGraphics = Graphics.FromImage(myBmpImage);
float pX = 0;
float pY = 0;
if ((position == ContentAlignment.BottomLeft) || (position == ContentAlignment.BottomRight)) pY -= height;
if ((position == ContentAlignment.BottomRight) || (position == ContentAlignment.TopRight)) pX -= width;
// Set Background color
myGraphics.Clear(Color.Transparent);
myGraphics.SmoothingMode = SmoothingMode.HighQuality;
myGraphics.TextRenderingHint = TextRenderingHint.AntiAlias;
if (fill != null)
myGraphics.FillEllipse(new SolidBrush(fill), pX, pY, width * 2, height * 2);
if (border != null)
myGraphics.DrawEllipse(new Pen(border), pX, pY, width * 2, height * 2);
myGraphics.Flush();
return (myBmpImage);
}
Ill upload test project later on to show how it works - right now you can pretty much copy-paste it.
Cheers,
Ofir