menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfTilingBrush - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfTilingBrush

    Implements a colored tiling brush.

    Inheritance
    System.Object
    PdfBrush
    PdfTilingBrush
    PdfHatchBrush
    Implements
    System.ICloneable
    Inherited Members
    PdfBrush.ICloneable.Clone()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Pdf.Graphics
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfTilingBrush : PdfBrush, ICloneable, IPdfWrapper
    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create new PDF tile brush.  
    PdfTilingBrush brush = new PdfTilingBrush(new RectangleF(0, 0, 11, 11));
    //Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 0, 10, 10));
    //Draw rectangle.
    graphics.DrawRectangle(brush, new RectangleF(0, 0, 200, 100));           
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create new PDF tile brush. 
    Dim brush As New PdfTilingBrush(New RectangleF(0, 0, 11, 11))
    'Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 0, 10, 10))
    'Draw rectangle.
    graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    Constructors

    PdfTilingBrush(RectangleF)

    Initializes a new instance of the PdfTilingBrush class.

    Declaration
    public PdfTilingBrush(RectangleF rectangle)
    Parameters
    Type Name Description
    System.Drawing.RectangleF rectangle

    The boundaries of the smallest brush cell.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create new PDF tile brush.  
    PdfTilingBrush brush = new PdfTilingBrush(new RectangleF(0, 0, 11, 11));
    //Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 0, 10, 10));
    //Draw rectangle.
    graphics.DrawRectangle(brush, new RectangleF(0, 0, 200, 100));           
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create new PDF tile brush. 
    Dim brush As New PdfTilingBrush(New RectangleF(0, 0, 11, 11))
    'Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 0, 10, 10))
    'Draw rectangle.
    graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfTilingBrush(RectangleF, PdfPage)

    Initializes a new instance of the PdfTilingBrush class.

    Declaration
    public PdfTilingBrush(RectangleF rectangle, PdfPage page)
    Parameters
    Type Name Description
    System.Drawing.RectangleF rectangle

    The boundaries of the smallest brush cell.

    PdfPage page

    The Current Page Object.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Set document color space
    doc.ColorSpace = PdfColorSpace.GrayScale;
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create new PDF tile brush.  
    PdfTilingBrush brush = new PdfTilingBrush(new RectangleF(0, 0, 11, 11), page);
    //Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 0, 10, 10));
    //Draw rectangle.
    graphics.DrawRectangle(brush, new RectangleF(0, 0, 200, 100));           
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Set document color space
    doc.ColorSpace = PdfColorSpace.GrayScale
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create new PDF tile brush. 
    Dim brush As New PdfTilingBrush(New RectangleF(0, 0, 11, 11), page)
    'Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 0, 10, 10))
    'Draw rectangle.
    graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfTilingBrush(RectangleF, Single)

    Initialize a new instance of PdfTilingBrush with the specified rectangle as the pattern and the outer size that defines the spacing between repeated instances of the pattern.

    Declaration
    public PdfTilingBrush(RectangleF rectangle, float outerSize)
    Parameters
    Type Name Description
    System.Drawing.RectangleF rectangle

    The rectangular region that serves as the pattern's area is defined.

    System.Single outerSize

    The spacing between the repeated instances of the pattern is defined by its size.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create new PDF tile brush.  
    PdfTilingBrush brush = new PdfTilingBrush(new RectangleF(0, 0, 11, 11), 842);
    //Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 0, 10, 10));
    //Draw rectangle.
    graphics.DrawRectangle(brush, new RectangleF(0, 0, 200, 100));           
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create new PDF tile brush. 
    Dim brush As New PdfTilingBrush(New RectangleF(0, 0, 11, 11), 842)
    'Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 0, 10, 10))
    'Draw rectangle.
    graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfTilingBrush(SizeF)

    Initializes a new instance of the PdfTilingBrush class.

    Declaration
    public PdfTilingBrush(SizeF size)
    Parameters
    Type Name Description
    System.Drawing.SizeF size

    The size of the smallest brush cell.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create new PDF tile brush.  
    PdfTilingBrush brush = new PdfTilingBrush(new SizeF(11, 11));
    //Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 0, 10, 10));
    //Draw rectangle.
    graphics.DrawRectangle(brush, new RectangleF(0, 0, 200, 100));           
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create new PDF tile brush. 
    Dim brush As New PdfTilingBrush(New SizeF(11, 11))
    'Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 0, 10, 10))
    'Draw rectangle.
    graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfTilingBrush(SizeF, PdfPage)

    Initializes a new instance of the PdfTilingBrush class.

    Declaration
    public PdfTilingBrush(SizeF size, PdfPage page)
    Parameters
    Type Name Description
    System.Drawing.SizeF size

    The size of the smallest brush cell.

    PdfPage page

    The Current Page Object.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Set document color space
    doc.ColorSpace = PdfColorSpace.GrayScale;
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create new PDF tile brush.  
    PdfTilingBrush brush = new PdfTilingBrush(new SizeF(11, 11), page);
    //Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 0, 10, 10));
    //Draw rectangle.
    graphics.DrawRectangle(brush, new RectangleF(0, 0, 200, 100));           
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Set document color space
    doc.ColorSpace = PdfColorSpace.GrayScale
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create new PDF tile brush. 
    Dim brush As New PdfTilingBrush(New SizeF(11, 11), page)
    'Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 0, 10, 10))
    'Draw rectangle.
    graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfTilingBrush(SizeF, Single)

    Initialize a new instance of PdfTilingBrush with the specified size for the pattern and the outer size that defines the spacing between repeated instances of the pattern.

    Declaration
    public PdfTilingBrush(SizeF size, float outerSize)
    Parameters
    Type Name Description
    System.Drawing.SizeF size

    Specify the dimensions of the pattern.

    System.Single outerSize

    The spacing between the repeated instances of the pattern is defined by its size.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create new PDF tile brush.  
    PdfTilingBrush brush = new PdfTilingBrush(new SizeF(11, 11), 842);
    //Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 0, 10, 10));
    //Draw rectangle.
    graphics.DrawRectangle(brush, new RectangleF(0, 0, 200, 100));           
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create new PDF tile brush. 
    Dim brush As New PdfTilingBrush(New SizeF(11, 11), 842)
    'Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 0, 10, 10))
    'Draw rectangle.
    graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    Properties

    Graphics

    Gets Graphics context of the brush.

    Declaration
    public PdfGraphics Graphics { get; }
    Property Value
    Type
    PdfGraphics
    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create new PDF tile brush.  
    PdfTilingBrush brush = new PdfTilingBrush(new RectangleF(0, 0, 11, 11));
    //Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 0, 10, 10));
    //Draw rectangle.
    graphics.DrawRectangle(brush, new RectangleF(0, 0, 200, 100));           
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create new PDF tile brush. 
    Dim brush As New PdfTilingBrush(New RectangleF(0, 0, 11, 11))
    'Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 0, 10, 10))
    'Draw rectangle.
    graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    Rectangle

    Gets the boundary box of the smallest brush cell.

    Declaration
    public RectangleF Rectangle { get; }
    Property Value
    Type
    System.Drawing.RectangleF
    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create new PDF tile brush.  
    PdfTilingBrush brush = new PdfTilingBrush(new RectangleF(0, 0, 11, 11));
    //Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 0, 10, 10));
    //Get the smallest cell bounds.
    RectangleF smallestCellBounds = brush.Rectangle;
    //Draw rectangle.
    graphics.DrawRectangle(brush, new RectangleF(0, 0, 200, 100));           
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create new PDF tile brush. 
    Dim brush As New PdfTilingBrush(New RectangleF(0, 0, 11, 11))
    'Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 0, 10, 10))
    'Get the smallest cell bounds.
    Dim smallestCellBounds As RectangleF = brush.Rectangle
    'Draw rectangle.
    graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    Size

    Gets the size of the smallest brush cell.

    Declaration
    public SizeF Size { get; }
    Property Value
    Type
    System.Drawing.SizeF
    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create new PDF tile brush.  
    PdfTilingBrush brush = new PdfTilingBrush(new RectangleF(0, 0, 11, 11));
    //Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 0, 10, 10));
    //Get the smallest cell size.
    SizeF smallestCellSize = brush.Size;
    //Draw rectangle.
    graphics.DrawRectangle(brush, new RectangleF(0, 0, 200, 100));           
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create new PDF tile brush. 
    Dim brush As New PdfTilingBrush(New RectangleF(0, 0, 11, 11))
    'Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 0, 10, 10))
    'Get the smallest cell size.
    Dim smallestCellSize As SizeF = brush.Size
    'Draw rectangle.
    graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    Methods

    Clone()

    Creates a new copy of a brush.

    Declaration
    public override PdfBrush Clone()
    Returns
    Type Description
    PdfBrush

    A new instance of the Brush class.

    Overrides
    PdfBrush.Clone()
    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create new PDF tile brush.  
    PdfTilingBrush brush = new PdfTilingBrush(new RectangleF(0, 0, 11, 11));
    //Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 0, 10, 10));
    //Draw rectangle.
    graphics.DrawRectangle(brush, new RectangleF(0, 0, 200, 100)); 
    //Clone the existing tile brush.
    PdfTilingBrush cBrush = brush.Clone() as PdfTilingBrush;
    //Draw rectangle.
    graphics.DrawRectangle(cBrush, new RectangleF(0, 150, 100, 100));
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create new PDF tile brush. 
    Dim brush As New PdfTilingBrush(New RectangleF(0, 0, 11, 11))
    'Draw rect inside the tile.
    brush.Graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 0, 10, 10))
    'Draw rectangle.
    graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
    'Clone the existing tile brush.
    Dim cBrush As PdfTilingBrush = TryCast(brush.Clone(), PdfTilingBrush)
    'Draw rectangle.
    graphics.DrawRectangle(cBrush, New RectangleF(0, 150, 100, 100))
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    Implements

    System.ICloneable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved