Show / Hide Table of Contents

Class ColorPt

ColorPt is an array of colorants (or tint values) representing a color point in an associated color space.

Inheritance
System.Object
ColorPt
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: pdftron.PDF
Assembly: PDFNet.dll
Syntax
public class ColorPt : IDisposable

Constructors

ColorPt()

Instantiates a new ColorPt object.

Declaration
public ColorPt()
Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

ColorPt(Double)

Instantiates a new ColorPt object.

Declaration
public ColorPt(double x)
Parameters
Type Name Description
System.Double x

initialized value of first color value (eg. red for rgb colorspace)

Remarks

All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

ColorPt(Double, Double)

Instantiates a new ColorPt object.

Declaration
public ColorPt(double x, double y)
Parameters
Type Name Description
System.Double x

initialized value of first color value (eg. red for rgb colorspace)

System.Double y

initialized value of second color value (eg. green for rgb colorspace)

Remarks

All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

ColorPt(Double, Double, Double)

Instantiates a new ColorPt object.

Declaration
public ColorPt(double x, double y, double z)
Parameters
Type Name Description
System.Double x

initialized value of first color value (eg. red for rgb colorspace)

System.Double y

initialized value of second color value (eg. green for rgb colorspace)

System.Double z

initialized value of third color value (eg. blue for rgb colorspace)

Remarks

All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

ColorPt(Double, Double, Double, Double)

Instantiates a new ColorPt object.

Declaration
public ColorPt(double x, double y, double z, double w)
Parameters
Type Name Description
System.Double x

initialized value of first color value (eg. red for rgb colorspace)

System.Double y

initialized value of second color value (eg. green for rgb colorspace)

System.Double z

initialized value of third color value (eg. blue for rgb colorspace)

System.Double w

initialized value of fourth color value (eg. when using CMYK)

Remarks

All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

Methods

Dispose()

Releases all resources used by the ColorPt

Declaration
public override sealed void Dispose()

Dispose(Boolean)

Declaration
[HandleProcessCorruptedStateExceptions]
protected virtual void Dispose(bool A_0)
Parameters
Type Name Description
System.Boolean A_0

Finalize()

Allows a ColorPt to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

Declaration
protected void Finalize()

Get(Int32)

Gets the tint value at a given colorant index.

Declaration
public double Get(int colorant_index)
Parameters
Type Name Description
System.Int32 colorant_index

the colorant_index

Returns
Type Description
System.Double

the tint value at the specified colorant index.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

op_Assign(ColorPt)

Assignment operator

Declaration
public ColorPt op_Assign(ColorPt r)
Parameters
Type Name Description
ColorPt r

object at the right of the operator

Returns
Type Description
ColorPt

object equals to the given object

op_Equality(ColorPt)

Equals operator

Declaration
public bool op_Equality(ColorPt other)
Parameters
Type Name Description
ColorPt other

object at the right of the operator

Returns
Type Description
System.Boolean

true if the colorant values of the objects are equal, false otherwise

Set(ColorPt)

Sets value to the given ColorPt object

Declaration
public void Set(ColorPt p)
Parameters
Type Name Description
ColorPt p

given ColorPt object

Set(Double)

Sets the first value x of the ColorPt.

Declaration
public void Set(double x)
Parameters
Type Name Description
System.Double x

initialized value of first color value (eg. red for rgb colorspace)

Remarks

All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

Set(Double, Double)

Sets the first two values x and y of the ColorPt.

Declaration
public void Set(double x, double y)
Parameters
Type Name Description
System.Double x

initialized value of first color value (eg. red for rgb colorspace)

System.Double y

initialized value of second color value (eg. green for rgb colorspace)

Remarks

All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

Set(Double, Double, Double)

Sets the first three values x, y, and z of the ColorPt.

Declaration
public void Set(double x, double y, double z)
Parameters
Type Name Description
System.Double x

initialized value of first color value (eg. red for rgb colorspace)

System.Double y

initialized value of second color value (eg. green for rgb colorspace)

System.Double z

initialized value of third color value (eg. blue for rgb colorspace)

Remarks

All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

Set(Double, Double, Double, Double)

A utility method to set the first 4 tint values. For example, color.Set(red, green, blue) will initialize the ColorPt to given tint values.

Declaration
public void Set(double x, double y, double z, double w)
Parameters
Type Name Description
System.Double x

initialized value of first color value (eg. red for rgb colorspace)

System.Double y

initialized value of second color value (eg. green for rgb colorspace)

System.Double z

initialized value of third color value (eg. blue for rgb colorspace)

System.Double w

initialized value of fourth color value (eg. when using CMYK)

Remarks

color.Set(gray) is equivalent to Set(0, gray);

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

Set(Int32, Double)

Sets the colorant index and value.

Declaration
public void Set(int colorant_index, double colorant_value)
Parameters
Type Name Description
System.Int32 colorant_index

the colorant_index. For example, for a color point associated with a Gray color space the only allowed value for index is 0. For a color point associated with a CMYK color space, the color_index can range from 0 (cyan) to 4 (black).

System.Double colorant_value

the colorant_value The new tint value.

Remarks

If a color point has more than 4 colorants, SetColorantNum(num_colorants) must be called before getting or setting tint values.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

PDFNetException

PDFNetException the PDFNet exception

SetColorantNum(Int32)

Sets the colorant number.

Declaration
public void SetColorantNum(int num)
Parameters
Type Name Description
System.Int32 num

the new colorant number

Remarks

If a color point has more than 4 colorants, SetColorantNum(num_colorants) must be called before getting or setting tint values. The number of colorants depends on the associated color space. To find how many colorant are associated with a given color space use color_space.GetComponentNum().

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

Implements

System.IDisposable
Back to top Generated by DocFX