PdfSharp.Drawing.XGraphics.DrawEllipse C# (CSharp) Method

DrawEllipse() public method

Draws an ellipse defined by a bounding rectangle.
public DrawEllipse ( XBrush brush, Rectangle rect ) : void
brush XBrush
rect Rectangle
return void
    public void DrawEllipse(XBrush brush, Rectangle rect)
    {
      DrawEllipse(brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height);
    }
#endif

Same methods

XGraphics::DrawEllipse ( XBrush brush, RectangleF rect ) : void
XGraphics::DrawEllipse ( XBrush brush, XRect rect ) : void
XGraphics::DrawEllipse ( XBrush brush, double x, double y, double width, double height ) : void
XGraphics::DrawEllipse ( XBrush brush, int x, int y, int width, int height ) : void
XGraphics::DrawEllipse ( XPen pen, Rectangle rect ) : void
XGraphics::DrawEllipse ( XPen pen, RectangleF rect ) : void
XGraphics::DrawEllipse ( XPen pen, XBrush brush, Rectangle rect ) : void
XGraphics::DrawEllipse ( XPen pen, XBrush brush, RectangleF rect ) : void
XGraphics::DrawEllipse ( XPen pen, XBrush brush, XRect rect ) : void
XGraphics::DrawEllipse ( XPen pen, XBrush brush, double x, double y, double width, double height ) : void
XGraphics::DrawEllipse ( XPen pen, XBrush brush, int x, int y, int width, int height ) : void
XGraphics::DrawEllipse ( XPen pen, XRect rect ) : void
XGraphics::DrawEllipse ( XPen pen, double x, double y, double width, double height ) : void
XGraphics::DrawEllipse ( XPen pen, int x, int y, int width, int height ) : void

Usage Example

    /// <summary>
    /// Demonstrates the use of XGraphics.DrawBeziers.
    /// </summary>
    public override void RenderPage(XGraphics gfx)
    {
      base.RenderPage(gfx);

      int n = 2;
      int count = 1 + 3 * n;
      XPoint[] points = new XPoint[count];
      Random rnd = new Random(42);
      for (int idx = 0; idx < count; idx++)
      {
        points[idx].X = 20 + rnd.Next(600);
        points[idx].Y = 50 + rnd.Next(800);
      }

      // Draw the points
      XPen pen = new XPen(XColors.Red, 0.5);
      pen.DashStyle = XDashStyle.Dash;
      for (int idx = 0; idx + 3 < count; idx += 3)
      {
        gfx.DrawEllipse(XBrushes.Red, MakeRect(points[idx]));
        gfx.DrawEllipse(XBrushes.Red, MakeRect(points[idx + 1]));
        gfx.DrawEllipse(XBrushes.Red, MakeRect(points[idx + 2]));
        gfx.DrawEllipse(XBrushes.Red, MakeRect(points[idx + 3]));
        gfx.DrawLine(pen, points[idx], points[idx + 1]);
        gfx.DrawLine(pen, points[idx + 2], points[idx + 3]);
      }

      // Draw the curve
      gfx.DrawBeziers(properties.Pen2.Pen, points);
    }
All Usage Examples Of PdfSharp.Drawing.XGraphics::DrawEllipse