Table of Contents

Class PdfBlend

Namespace
Syncfusion.Pdf.Graphics
Assembly
Syncfusion.Pdf.Portable.dll

Represents the blend color space

public sealed class PdfBlend : PdfBlendBase
Inheritance
PdfBlend
Inherited Members

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 brush.  
PdfLinearGradientBrush brush = new PdfLinearGradientBrush(new PointF(0, 0), new PointF(200, 100), Color.Red, Color.Blue);
//Create PDF blend
PdfBlend blend = new PdfBlend();
//Set blend to the brush.
brush.Blend = blend; 
//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 brush.           
Dim brush As New PdfLinearGradientBrush(New PointF(0, 0), New PointF(200, 100), Color.Red, Color.Blue)
'Create PDF blend
Dim blend As New PdfBlend()
'Set blend to the brush.
brush.Blend = blend
'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

PdfBlend()

Initializes a new instance of the PdfBlend class.

public PdfBlend()

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 brush.  
PdfLinearGradientBrush brush = new PdfLinearGradientBrush(new PointF(0, 0), new PointF(200, 100), Color.Red, Color.Blue);
//Create PDF blend
PdfBlend blend = new PdfBlend();
//Set blend to the brush.
brush.Blend = blend; 
//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 brush.           
Dim brush As New PdfLinearGradientBrush(New PointF(0, 0), New PointF(200, 100), Color.Red, Color.Blue)
'Create PDF blend
Dim blend As New PdfBlend()
'Set blend to the brush.
brush.Blend = blend
'Draw rectangle.
graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
'Save the document.
doc.Save("Output.pdf")
'Close the document.
doc.Close(True)

PdfBlend(int)

Initializes a new instance of the PdfBlend class with the specified factor count

public PdfBlend(int count)

Parameters

count int

The number of elements in the factors and positions arrays.

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 brush.  
PdfLinearGradientBrush brush = new PdfLinearGradientBrush(new PointF(0, 0), new PointF(200, 100), Color.Red, Color.Blue);
//Create PDF blend
PdfBlend blend = new PdfBlend(1);
//Set blend to the brush.
brush.Blend = blend; 
//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 brush.           
Dim brush As New PdfLinearGradientBrush(New PointF(0, 0), New PointF(200, 100), Color.Red, Color.Blue)
'Create PDF blend
Dim blend As New PdfBlend(1)
'Set blend to the brush.
brush.Blend = blend
'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

Factors

Gets or sets the array of factor to the blend.

public float[] Factors { get; set; }

Property Value

float[]

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 brush.  
PdfLinearGradientBrush brush = new PdfLinearGradientBrush(new PointF(0, 0), new PointF(200, 100), Color.Red, Color.Blue);
//Create PDF blend
PdfBlend blend = new PdfBlend();
//Set factors
blend.Factors = new float[] {1};
//Set poistions
blend.Positions = new float[] {0};
//Set blend to the brush.
brush.Blend = blend; 
//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 brush.           
Dim brush As New PdfLinearGradientBrush(New PointF(0, 0), New PointF(200, 100), Color.Red, Color.Blue)
'Create PDF blend
Dim blend As New PdfBlend()
'Set factors
blend.Factors = New Single() {1}
'Set poistions
blend.Positions = New Single() {0}
'Set blend to the brush.
brush.Blend = blend
'Draw rectangle.
graphics.DrawRectangle(brush, New RectangleF(0, 0, 200, 100))
'Save the document.
doc.Save("Output.pdf")
'Close the document.
doc.Close(True)