Xamarin.Android

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

    Show / Hide Table of Contents

    Class PdfLinearGradientMode

    Specifies the gradient direction of the linear gradient brush.

    Inheritance
    System.Object
    PdfLinearGradientMode
    Namespace: Syncfusion.Pdf.Graphics
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public sealed class PdfLinearGradientMode : Enum
    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 gradient brush.  
     PdfLinearGradientBrush brush = new PdfLinearGradientBrush(new RectangleF(0, 0,200, 100), new PdfColor(Color.Red), new PdfColor(Color.Blue), PdfLinearGradientMode.Vertical);
    //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 gradient brush.           
    Dim brush As New PdfLinearGradientBrush(New RectangleF(0, 0, 200, 100), New PdfColor(Color.Red), New PdfColor(Color.Blue), PdfLinearGradientMode.Vertical)
    'Draw rectangle.
    graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    Fields

    BackwardDiagonal

    Specifies a gradient from upper right to lower left.

    Declaration
    public const PdfLinearGradientMode BackwardDiagonal
    Field Value
    Type Description
    PdfLinearGradientMode

    ForwardDiagonal

    Specifies a gradient from upper left to lower right.

    Declaration
    public const PdfLinearGradientMode ForwardDiagonal
    Field Value
    Type Description
    PdfLinearGradientMode

    Horizontal

    Specifies a gradient from left to right.

    Declaration
    public const PdfLinearGradientMode Horizontal
    Field Value
    Type Description
    PdfLinearGradientMode

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32

    Vertical

    Specifies a gradient from top to bottom.

    Declaration
    public const PdfLinearGradientMode Vertical
    Field Value
    Type Description
    PdfLinearGradientMode
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved