Fills an ellipse.
Namespace:
Aurigma.GraphicsMill.Drawing
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public Sub FillEllipse ( _ brush As Brush, _ x As Integer, _ y As Integer, _ width As Integer, _ height As Integer _ )
Type: Aurigma.GraphicsMill.Drawing.Brush
Brush object which is used to fill an ellipse.Type: System.Int32
X-coordinate of the top left corner of the bounding rectangle for the ellipse.Type: System.Int32
Y-coordinate of the top left corner of the bounding rectangle for the ellipse.Type: System.Int32
Width of the bounding rectangle for the ellipse.Type: System.Int32
Height of the bounding rectangle for the ellipse.// Let's assume we have centerX, centerY - coordinates of the ellipse center, // horizontalRadius and verticalRadius - radiuses of the ellipse. // We are calculating rectX, rectY, rectWidth, and rectHeight which specify // bounding rectangle for ellipse. rectX = centerX - horizontalRadius; rectY = centerY - verticalRadius; rectWidth = horizontalRadius * 2; rectHeight = verticalRadius * 2;
All the coordinates are measured in units specified with Unit property.
To outline an ellipse, use DrawEllipse(Pen, Int32, Int32, Int32, Int32) method.
Dim bitmap As New Aurigma.GraphicsMill.Bitmap( _ Aurigma.GraphicsMill.RgbColor.White, 185, 145, _ Aurigma.GraphicsMill.PixelFormat.Format24bppRgb) Dim graphics As Aurigma.GraphicsMill.Drawing.GdiGraphics = bitmap.GetGdiGraphics() 'Draw filled and outlined rectangle Dim pen As New Aurigma.GraphicsMill.Drawing.Pen(Aurigma.GraphicsMill.RgbColor.Red, 3) Dim brush As New Aurigma.GraphicsMill.Drawing.SolidBrush( _ Aurigma.GraphicsMill.RgbColor.FromRgb(&HDD, &HDD, &HFF)) graphics.FillRectangle(brush, 10, 10, 100, 60) graphics.DrawRectangle(pen, 10, 10, 100, 60) 'Draw filled but non-outlined ellipse brush.Color = Aurigma.GraphicsMill.RgbColor.Yellow graphics.FillEllipse(brush, 60, 40, 100, 80) 'Draw outlined but non-filled polygon pen.Color = Aurigma.GraphicsMill.RgbColor.Green pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot pen.Width = 1 Dim points As System.Drawing.Point() = { _ New System.Drawing.Point(20, 30), New System.Drawing.Point(50, 2), _ New System.Drawing.Point(180, 30), New System.Drawing.Point(80, 140)} graphics.DrawPolygon(pen, points)
Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap( Aurigma.GraphicsMill.RgbColor.White, 185, 145, Aurigma.GraphicsMill.PixelFormat.Format24bppRgb); Aurigma.GraphicsMill.Drawing.GdiGraphics graphics = bitmap.GetGdiGraphics(); //Draw filled and outlined rectangle Aurigma.GraphicsMill.Drawing.Pen pen = new Aurigma.GraphicsMill.Drawing.Pen( Aurigma.GraphicsMill.RgbColor.Red, 3); Aurigma.GraphicsMill.Drawing.SolidBrush brush = new Aurigma.GraphicsMill.Drawing.SolidBrush( Aurigma.GraphicsMill.RgbColor.FromRgb(0xDD, 0xDD, 0xFF)); graphics.FillRectangle(brush, 10, 10, 100, 60); graphics.DrawRectangle(pen, 10, 10, 100, 60); //Draw filled but non-outlined ellipse brush.Color = Aurigma.GraphicsMill.RgbColor.Yellow; graphics.FillEllipse(brush, 60, 40, 100, 80); //Draw outlined but non-filled polygon pen.Color = Aurigma.GraphicsMill.RgbColor.Green; pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; pen.Width = 2; System.Drawing.Point[] points = { new System.Drawing.Point(20, 30), new System.Drawing.Point(50, 2), new System.Drawing.Point(180, 30), new System.Drawing.Point(80, 140)}; graphics.DrawPolygon(pen, points);