|
|
[C#]
void DrawEllipse(Pen pen, double x, double y, double width, double height);
void DrawEllipse(Pen pen, RectangleF rect);
[Visual Basic]
Sub DrawEllipse(pen As Pen, x As Double, y As Double, width As Double, height As Double)
Sub DrawEllipse(pen As Pen, rect As RectangleF)
|
|
|
|
Here we draw two shapes, one blue and one red. The blue shape
uses the Bitmap default colors.
[C#]
using (Bitmap bm = new Bitmap(400, 400)) {
using (Graphics gr = Graphics.FromImage(bm)) {
gr.FillEllipse(Brushes.Blue, new RectangleF(0, 0, 200, 200));
gr.DrawEllipse(new Pen(Color.DarkBlue), new RectangleF(0, 0, 200, 200));
gr.FillEllipse(Brushes.Red, new RectangleF(50, 50, 50, 50));
gr.DrawEllipse(new Pen(Color.DarkRed), new RectangleF(200, 200, 200, 200));
}
bm.Save(Server.MapPath("IG8_Graphics_DrawEllipse.png"));
}

IG8_Graphics_DrawEllipse.png
|