Xamarin.iOS

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfTilingBrush

    Show / Hide Table of Contents

    Class PdfTilingBrush

    Implements a colored tiling brush.

    Inheritance
    System.Object
    PdfBrush
    PdfTilingBrush
    Implements
    ICloneable
    Inherited Members
    PdfBrush.ICloneable.Clone()
    Namespace: Syncfusion.Pdf.Graphics
    Assembly: Syncfusion.Pdf.Portable.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
    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
    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(SizeF)

    Initializes a new instance of the PdfTilingBrush class.

    Declaration
    public PdfTilingBrush(SizeF size)
    Parameters
    Type Name Description
    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
    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)

    Properties

    Graphics

    Gets Graphics context of the brush.

    Declaration
    public PdfGraphics Graphics { get; }
    Property Value
    Type Description
    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 Description
    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 Description
    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

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