Click or drag to resize
Pdf Library for .NET

PdfGradient Class

Represents a linear gradient fill for PDF graphic elements. Assign an instance to a graphic element's Gradient property to fill it with a two-color gradient.
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalPdfGradient

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public class PdfGradient

The PdfGradient type exposes the following members.

Constructors
 NameDescription
Public methodPdfGradient(PdfColor, PdfColor) Initializes a new instance of the PdfGradient class with the specified colors.
Public methodPdfGradient(PdfColor, PdfColor, PdfGradientDirection) Initializes a new instance of the PdfGradient class with the specified colors and direction.
Public methodPdfGradient(PdfGradientDirection, PdfColor, PdfColor) Initializes a new instance of the PdfGradient class with the specified direction and colors.
Top
Properties
 NameDescription
Public propertyEndColor Gets or sets the end color of the gradient.
Public propertyGradientDirection Gets or sets the gradient direction.
Public propertyStartColor Gets or sets the start color of the gradient.
Top
Example
PdfRectangleElement rect = new PdfRectangleElement(0, 0, 200, 80);
rect.Gradient = new PdfGradient(PdfGradientDirection.Horizontal,
    new PdfColor(255, 0, 0), new PdfColor(0, 0, 255));
See Also