Class PdfLinearGradientMode
Specifies the gradient direction of the linear gradient brush.
Inheritance
System.Object
PdfLinearGradientMode
Namespace: Syncfusion.Pdf.Graphics
Assembly: Syncfusion.Pdf.UWP.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 |
---|
PdfLinearGradientMode |
ForwardDiagonal
Specifies a gradient from upper left to lower right.
Declaration
public const PdfLinearGradientMode ForwardDiagonal
Field Value
Type |
---|
PdfLinearGradientMode |
Horizontal
Specifies a gradient from left to right.
Declaration
public const PdfLinearGradientMode Horizontal
Field Value
Type |
---|
PdfLinearGradientMode |
Vertical
Specifies a gradient from top to bottom.
Declaration
public const PdfLinearGradientMode Vertical
Field Value
Type |
---|
PdfLinearGradientMode |