cete.dynamicpdf.autogradient
AutoGradient
- Namespace: ceTe.DynamicPDF
- Assemblies: DynamicPDF.CoreSuite.dll
Represents an automatically calculated gradient pattern.
public class AutoGradient : Gradient
Public Class AutoGradient
Inherits Gradient
Inheritance: Object → Color → Pattern → Gradient → AutoGradient
Licensing Info
This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
The following example will display a custom rectangle on the page with autogradient pattern.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Create a Page and add it to the document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
' Create a rectangle
Dim MyRectangle As Rectangle = New Rectangle(50, 50, 200, _
200, Grayscale.Black, RgbColor.Gray, 4, LineStyle.Solid)
' Change the corner radius property
MyRectangle.CornerRadius = 10
' Create a autogradient
Dim MyAutoGradient As AutoGradient = New AutoGradient(90.0F, CmykColor.Blue, CmykColor.Red)
' Assign autogradient to FillColor property of rectangle
MyRectangle.FillColor = MyAutoGradient
' Add the rectangle to the page
MyPage.Elements.Add(MyRectangle)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
// Create a Page and add it to the document
Page page = new Page();
// Add page to document
document.Pages.Add( page );
// Create a rectangle
Rectangle rectangle = new Rectangle( 50, 50, 200, 200, Grayscale.Black, RgbColor.Gray, 4, LineStyle.Solid );
// Change the corner radius property
rectangle.CornerRadius = 10;
// Create a autogradient
AutoGradient autogradient = new AutoGradient(90.0f, CmykColor.Blue, CmykColor.Red);
// Assign autogradient to FillColor property of rectangle
rectangle.FillColor = autogradient;
// Add the rectangle to the page
page.Elements.Add( rectangle );
// Save the PDF
document.Draw( outputPath );
}
}
Remarks
See the Colors topic for more on gradient patterns.
NOTE: The X1, Y1, X2 and Y2 properties of this class will be automatically calculated. If these values are set, they will be overwritten.
Constructors
AutoGradient(Single, CmykColor, CmykColor)
Initializes a new instance of the AutoGradient class.
public AutoGradient(float angle, CmykColor color1, CmykColor color2)
Public Sub New (angle As Single, color1 As CmykColor, color2 As CmykColor)
Parameters
- angle: Single
Angle of the AutoGradient.
- color1: CmykColor
First CMYK color.
- color2: CmykColor
Second CMYK color.
Licensing Info
This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
NOTE: The X1, Y1, X2 and Y2 properties of this class will be automatically calculated. If these values are set, they will be overwritten.
AutoGradient(Single, Grayscale, Grayscale)
Initializes a new instance of the AutoGradient class.
public AutoGradient(float angle, Grayscale color1, Grayscale color2)
Public Sub New (angle As Single, color1 As Grayscale, color2 As Grayscale)
Parameters
- angle: Single
Angle of the AutoGradient.
- color1: Grayscale
First Grayscale color.
- color2: Grayscale
Second Grayscale color.
Licensing Info
This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
NOTE: The X1, Y1, X2 and Y2 properties of this class will be automatically calculated. If these values are set, they will be overwritten.
AutoGradient(Single, RgbColor, RgbColor)
Initializes a new instance of the AutoGradient class.
public AutoGradient(float angle, RgbColor color1, RgbColor color2)
Public Sub New (angle As Single, color1 As RgbColor, color2 As RgbColor)
Parameters
- angle: Single
Angle of the AutoGradient.
- color1: RgbColor
First RGB color.
- color2: RgbColor
Second RGB color.
Licensing Info
This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
NOTE: The X1, Y1, X2 and Y2 properties of this class will be automatically calculated. If these values are set, they will be overwritten.
Properties
Angle
Gets or sets the angle of the Gradient.
public float Angle { get; set; }
Public Property Angle As Single
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Color1
Gets the first color. (Inherited from Gradient)
public DeviceColor Color1 { get; }
Public Property Color1 As DeviceColor
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Color2
Gets the second color. (Inherited from Gradient)
public DeviceColor Color2 { get; }
Public Property Color2 As DeviceColor
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
ColorSpace
Gets the color space for the color. (Inherited from Gradient)
public ColorSpace ColorSpace { get; }
Public Property ColorSpace As ColorSpace
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
X1
Gets or sets the X coordinate of the first color. (Inherited from Gradient)
public float X1 { get; set; }
Public Property X1 As Single
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
X2
Gets or sets the X coordinate of the second color. (Inherited from Gradient)
public float X2 { get; set; }
Public Property X2 As Single
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Y1
Gets or sets the Y coordinate of the first color. (Inherited from Gradient)
public float Y1 { get; set; }
Public Property Y1 As Single
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Y2
Gets or sets the Y coordinate of the second color. (Inherited from Gradient)
public float Y2 { get; set; }
Public Property Y2 As Single
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Methods
DrawFill(OperatorWriter)
Draws the color data to the given OperatorWriter object. (Inherited from Color)
public void DrawFill(OperatorWriter writer)
Sub DrawFill(writer As OperatorWriter)
Parameters
- writer: OperatorWriter
OperatorWriter object to receive the color data.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
DrawFill(PageWriter)
Draws the color data to the given PageWriter object.
public void DrawFill(PageWriter writer)
Sub DrawFill(writer As PageWriter)
Parameters
- writer: PageWriter
PageWriter object to receive the color data.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
DrawStroke(OperatorWriter)
Draws the color data to the given OperatorWriter object. (Inherited from Color)
public void DrawStroke(OperatorWriter writer)
Sub DrawStroke(writer As OperatorWriter)
Parameters
- writer: OperatorWriter
OperatorWriter object to receive the color data.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
DrawStroke(PageWriter)
Draws the color data to the given PageWriter object.
public void DrawStroke(PageWriter writer)
Sub DrawStroke(writer As PageWriter)
Parameters
- writer: PageWriter
PageWriter object to receive the color data.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Equals(Object)
Tests equality of colors. (Inherited from Gradient)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
Object to compare to the current Color .
Returns
true if the two colors are equal
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
GetHashCode()
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Gradient)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Color object.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
GetResource(PageWriter)
Gets the resource for the gradient. (Inherited from Gradient)
public Resource GetResource(PageWriter writer)
Function GetResource(writer As PageWriter) As Resource
Parameters
- writer: PageWriter
PageWriter object to receive the gradient color data.
Returns
The Resource used for the gradient.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.