cete.dynamicpdf.pageelements.curvesubpath
CurveSubPath
- Namespace: ceTe.DynamicPDF.PageElements
- Assemblies: ceTe.DynamicPDF.40.dll
Represents a Bézier curve subpath.
public class CurveSubPath : SubPath
Public Class CurveSubPath
Inherits SubPath
Inheritance: Object → SubPath → CurveSubPath
Licensing
This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:
- DynamicPDF Generator for .NET Professional Edition
- DynamicPDF Generator for .NET Enterprise Edition
- DynamicPDF Merger for .NET Professional Edition
- DynamicPDF Merger for .NET Enterprise Edition
- DynamicPDF ReportWriter for .NET Professional Edition
- DynamicPDF ReportWriter for .NET Enterprise Edition
- DynamicPDF Core Suite for .NET Professional Edition
- DynamicPDF Core Suite for .NET Enterprise Edition
Examples
The following example will display a path that incorporates several different subpaths before retuning to its starting location.
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 path
Dim MyPath As Path = New Path(50, 150, RgbColor.Blue, RgbColor.Yellow, _ 3, LineStyle.Solid, True)
' Add some sub paths to the path
MyPath.SubPaths.Add(New CurveSubPath(50, 400, 300, 150, -200, 400))
MyPath.SubPaths.Add(New LineSubPath(300, 400))
MyPath.SubPaths.Add(New CurveToSubPath(300, 150, 50, 300))
MyPath.SubPaths.Add(New CurveFromSubPath(150, 100, 200, -100))
' Add the path to the page
MyPage.Elements.Add(MyPath)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
class MyClass
{
static void Main()
{
// Create a PDF Document
Document document = new Document();
// Create a Page and add it to the document
Page page = new Page();
document.Pages.Add( page );
// Create a path
Path path = new Path( 50, 150, RgbColor.Blue, RgbColor.Yellow, 3, LineStyle.Solid, true );
// Add some sub paths to the path
path.SubPaths.Add( new CurveSubPath( 50, 400, 300, 150, -200, 400 ) );
path.SubPaths.Add( new LineSubPath( 300, 400 ) );
path.SubPaths.Add( new CurveToSubPath( 300, 150, 50, 300 ) );
path.SubPaths.Add( new CurveFromSubPath( 150, 100, 200, -100 ) );
// Add the path to the page
page.Elements.Add( path );
// Save the PDF
document.Draw( @"C:\MyDocument.pdf" );
}
}
Remarks
This class, when added to a Path , is used to create a Bézier curve to the CurveSubPath's specified location using the source and destination control points.
Constructors
CurveSubPath(Single, Single, Single, Single, Single, Single)
Initializes a new instance of the CurveSubPath class.
public CurveSubPath(float x, float y, float sourceControlPointX, float sourceControlPointY, float destinationControlPointX, float destinationControlPointY)
Public Sub New (x As Single, y As Single, sourceControlPointX As Single, sourceControlPointY As Single, destinationControlPointX As Single, destinationControlPointY As Single)
Parameters
- x: Single
X coordinate of the destination.
- y: Single
Y coordinate of the destination.
- sourceControlPointX: Single
X coordinate of the sources control point.
- sourceControlPointY: Single
Y coordinate of the sources control point.
- destinationControlPointX: Single
X coordinate of the destinations control point.
- destinationControlPointY: Single
Y coordinate of the destinations control point.
Properties
DestinationControlPointX
Gets or sets the X coordinate of the destinations control point.
public float DestinationControlPointX { get; set; }
Public Property DestinationControlPointX As Single
Property Value
DestinationControlPointY
Gets or sets the Y coordinate of the destinations control point.
public float DestinationControlPointY { get; set; }
Public Property DestinationControlPointY As Single
Property Value
SourceControlPointX
Gets or sets the X coordinate of the sources control point.
public float SourceControlPointX { get; set; }
Public Property SourceControlPointX As Single
Property Value
SourceControlPointY
Gets or sets the Y coordinate of the sources control point.
public float SourceControlPointY { get; set; }
Public Property SourceControlPointY As Single
Property Value
X
Gets or sets the X coordinate of the destination.
public float X { get; set; }
Public Property X As Single
Property Value
Y
Gets or sets the Y coordinate of the destination.
public float Y { get; set; }
Public Property Y As Single
Property Value
Methods
Draw(PageWriter)
Draws the sub path to the given PageWriter object.
public void Draw(PageWriter writer)
Sub Draw(writer As PageWriter)
Parameters
- writer: PageWriter
PageWriter object to receive the sub path's output.
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
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.
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 .