Back to Devexpress

PdfGraphics.FillEllipse(DXBrush, RectangleF) Method

officefileapi-devexpress-dot-pdf-dot-pdfgraphics-dot-fillellipse-x28-devexpress-dot-drawing-dot-dxbrush-system-dot-drawing-dot-rectanglef-x29.md

latest3.8 KB
Original Source

PdfGraphics.FillEllipse(DXBrush, RectangleF) Method

Fills the interior of an ellipse located in the specified page rectangle.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Drawing.dll

NuGet Package : DevExpress.Pdf.Drawing

Declaration

csharp
public void FillEllipse(
    DXBrush brush,
    RectangleF rect
)
vb
Public Sub FillEllipse(
    brush As DXBrush,
    rect As RectangleF
)

Parameters

NameTypeDescription
brushDXBrush

A DXBrush object that specifies the brush used to fill the ellipse.

| | rect | RectangleF |

A RectangleF structure that specifies a page area (in world coordinate system) where you can draw an ellipse.

|

Remarks

This method fills the ellipse interior with a brush. The rect parameter specifies the ellipse boundaries.

To draw a shape on the PDF page, use one of the following methods:

PdfGraphics.AddToPageForeground, PdfGraphics.AddToPageBackgroundThese methods allow you to draw content on an existing page.PdfDocumentProcessor.RenderNewPageDraws content on a new page.

The following code snippet fills an ellipse with the specified brush.

csharp
using DevExpress.Pdf;
using System.Drawing;
using DevExpress.Drawing;
//...

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
    processor.CreateEmptyDocument();
    PdfPage page = processor.AddNewPage(PdfPaperSize.A4);
        using (PdfGraphics graphics = processor.CreateGraphicsWorldSystem())
        {
            // Fill an ellipse.
            using (var brush = new DXSolidBrush(Color.Blue))
                graphics.FillEllipse(brush, new RectangleF(50, 50, 500, 300));

            // Add graphics content to the document page.
            graphics.AddToPageForeground(page);
        }
    processor.SaveDocument("out2.pdf");
}
Process.Start("out.pdf");
vb
Imports DevExpress.Pdf
Imports System.Drawing
Imports DevExpress.Drawing
'...

Using processor As New PdfDocumentProcessor()
    processor.CreateEmptyDocument()
    Dim page As PdfPage = processor.AddNewPage(PdfPaperSize.A4)
        Using graphics As PdfGraphics = processor.CreateGraphicsWorldSystem()
            ' Fill an ellipse.
            Using brush = New DXSolidBrush(Color.Blue)
                graphics.FillEllipse(brush, New RectangleF(50, 50, 500, 300))
            End Using

            ' Add graphics content to the document page.
            graphics.AddToPageForeground(page)
        End Using
    processor.SaveDocument("out2.pdf")
End Using
Process.Start("out.pdf")

See Also

PdfGraphics Class

PdfGraphics Members

DevExpress.Pdf Namespace