PdfCalRGBColor Class
Represents a calibrated RGB color, based on a CalRGB colorspace.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Pdf.ColorSpace
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfCalRGBColor : PdfExtendedColor
Examples
// Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = doc.Pages.Add();
RectangleF rect = new RectangleF(20, 70, 200, 100);
// Creates RedColorSpace
PdfCalRGBColorSpace calRgbCS = new PdfCalRGBColorSpace();
calRgbCS.Gamma = new double[] { 1.6, 1.1, 2.5 };
calRgbCS.Matrix = new double[] { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
calRgbCS.WhitePoint = new double[] { 0.2, 1, 0.8 };
PdfCalRGBColor red = new PdfCalRGBColor(calRgbCS);
red.Red = 0;
red.Green = 1;
red.Blue = 0;
PdfPen pen = new PdfPen(red);
PdfBrush brush = new PdfSolidBrush(red);
// Draw the rectangle
page.Graphics.DrawRectangle(pen, rect);
doc.Save("CalRedColorSpace.pdf");
' Create a new PDF document.
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
' Gets the graphics object.
Dim g As PdfGraphics = page.Graphics
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 14, PdfFontStyle.Bold)
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
' Creates RedColorSpace
Dim calRgbCS As PdfCalRGBColorSpace = New PdfCalRGBColorSpace()
calRgbCS.Gamma = New Double() { 1.6, 1.1, 2.5 }
calRgbCS.Matrix = New Double() { 1, 0, 0, 0, 1, 0, 0, 0, 1 }
calRgbCS.WhitePoint = New Double() { 0.2, 1, 0.8 }
Dim red As PdfCalRGBColor = New PdfCalRGBColor(calRgbCS)
red.Red = 0
red.Green = 1
red.Blue = 0
Dim pen As PdfPen = New PdfPen(red)
Dim brush As PdfBrush = New PdfSolidBrush(red)
' Draw the rectangle
page.Graphics.DrawRectangle(pen, rect)
doc.Save("CalRedColorSpace.pdf")
Constructors
PdfCalRGBColor(PdfColorSpaces)
Initializes a new instance of the PdfCalRGBColor class.
Declaration
public PdfCalRGBColor(PdfColorSpaces colorspace)
Parameters
Type | Name | Description |
---|---|---|
PdfColorSpaces | colorspace | The colorspace |
Examples
// Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = doc.Pages.Add();
RectangleF rect = new RectangleF(20, 70, 200, 100);
// Creates RedColorSpace
PdfCalRGBColorSpace calRgbCS = new PdfCalRGBColorSpace();
calRgbCS.Gamma = new double[] { 1.6, 1.1, 2.5 };
calRgbCS.Matrix = new double[] { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
calRgbCS.WhitePoint = new double[] { 0.2, 1, 0.8 };
PdfCalRGBColor red = new PdfCalRGBColor(calRgbCS);
red.Red = 0;
red.Green = 1;
red.Blue = 0;
PdfPen pen = new PdfPen(red);
PdfBrush brush = new PdfSolidBrush(red);
// Draw the rectangle
page.Graphics.DrawRectangle(pen, rect);
doc.Save("CalRedColorSpace.pdf");
' Create a new PDF document.
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
' Gets the graphics object.
Dim g As PdfGraphics = page.Graphics
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 14, PdfFontStyle.Bold)
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
' Creates RedColorSpace
Dim calRgbCS As PdfCalRGBColorSpace = New PdfCalRGBColorSpace()
calRgbCS.Gamma = New Double() { 1.6, 1.1, 2.5 }
calRgbCS.Matrix = New Double() { 1, 0, 0, 0, 1, 0, 0, 0, 1 }
calRgbCS.WhitePoint = New Double() { 0.2, 1, 0.8 }
Dim red As PdfCalRGBColor = New PdfCalRGBColor(calRgbCS)
red.Red = 0
red.Green = 1
red.Blue = 0
Dim pen As PdfPen = New PdfPen(red)
Dim brush As PdfBrush = New PdfSolidBrush(red)
' Draw the rectangle
page.Graphics.DrawRectangle(pen, rect)
doc.Save("CalRedColorSpace.pdf")
See Also
Properties
Blue
Gets or sets the Blue value.
Declaration
public double Blue { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The blue level of this color. |
Remarks
The acceptable range for this value is [0.0 1.0]. 0.0 means the darkest color that can be achieved, and 1.0 means the lightest.
Examples
// Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = doc.Pages.Add();
RectangleF rect = new RectangleF(20, 70, 200, 100);
// Creates RedColorSpace
PdfCalRGBColorSpace calRgbCS = new PdfCalRGBColorSpace();
calRgbCS.Gamma = new double[] { 1.6, 1.1, 2.5 };
calRgbCS.Matrix = new double[] { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
calRgbCS.WhitePoint = new double[] { 0.2, 1, 0.8 };
PdfCalRGBColor red = new PdfCalRGBColor(calRgbCS);
red.Blue = 0;
PdfPen pen = new PdfPen(red);
PdfBrush brush = new PdfSolidBrush(red);
// Draw the rectangle
page.Graphics.DrawRectangle(pen, rect);
doc.Save("CalRedColorSpace.pdf");
' Create a new PDF document.
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
' Gets the graphics object.
Dim g As PdfGraphics = page.Graphics
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 14, PdfFontStyle.Bold)
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
' Creates RedColorSpace
Dim calRgbCS As PdfCalRGBColorSpace = New PdfCalRGBColorSpace()
calRgbCS.Gamma = New Double() { 1.6, 1.1, 2.5 }
calRgbCS.Matrix = New Double() { 1, 0, 0, 0, 1, 0, 0, 0, 1 }
calRgbCS.WhitePoint = New Double() { 0.2, 1, 0.8 }
Dim red As PdfCalRGBColor = New PdfCalRGBColor(calRgbCS)
red.Green = 1
Dim pen As PdfPen = New PdfPen(red)
Dim brush As PdfBrush = New PdfSolidBrush(red)
' Draw the rectangle
page.Graphics.DrawRectangle(pen, rect)
doc.Save("CalRedColorSpace.pdf")
See Also
Green
Gets or sets the green level for this color.
Declaration
public double Green { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The green level of this color. |
Remarks
The acceptable range for this value is [0.0 1.0]. 0.0 means the darkest color that can be achieved, and 1.0 means the lightest color.
Examples
// Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = doc.Pages.Add();
RectangleF rect = new RectangleF(20, 70, 200, 100);
// Creates RedColorSpace
PdfCalRGBColorSpace calRgbCS = new PdfCalRGBColorSpace();
calRgbCS.Gamma = new double[] { 1.6, 1.1, 2.5 };
calRgbCS.Matrix = new double[] { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
calRgbCS.WhitePoint = new double[] { 0.2, 1, 0.8 };
PdfCalRGBColor red = new PdfCalRGBColor(calRgbCS);
red.Green = 1;
PdfPen pen = new PdfPen(red);
PdfBrush brush = new PdfSolidBrush(red);
// Draw the rectangle
page.Graphics.DrawRectangle(pen, rect);
doc.Save("CalRedColorSpace.pdf");
' Create a new PDF document.
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
' Gets the graphics object.
Dim g As PdfGraphics = page.Graphics
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 14, PdfFontStyle.Bold)
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
' Creates RedColorSpace
Dim calRgbCS As PdfCalRGBColorSpace = New PdfCalRGBColorSpace()
calRgbCS.Gamma = New Double() { 1.6, 1.1, 2.5 }
calRgbCS.Matrix = New Double() { 1, 0, 0, 0, 1, 0, 0, 0, 1 }
calRgbCS.WhitePoint = New Double() { 0.2, 1, 0.8 }
Dim red As PdfCalRGBColor = New PdfCalRGBColor(calRgbCS)
red.Green = 1
Dim pen As PdfPen = New PdfPen(red)
Dim brush As PdfBrush = New PdfSolidBrush(red)
' Draw the rectangle
page.Graphics.DrawRectangle(pen, rect)
doc.Save("CalRedColorSpace.pdf")
See Also
Red
Gets or sets the red level for this color.
Declaration
public double Red { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The red level of this color. |
Remarks
The acceptable range for this value is [0.0 1.0]. 0.0 means the darkest color that can be achieved, and 1.0 means the lightest color.
Examples
// Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = doc.Pages.Add();
RectangleF rect = new RectangleF(20, 70, 200, 100);
// Creates RedColorSpace
PdfCalRGBColorSpace calRgbCS = new PdfCalRGBColorSpace();
calRgbCS.Gamma = new double[] { 1.6, 1.1, 2.5 };
calRgbCS.Matrix = new double[] { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
calRgbCS.WhitePoint = new double[] { 0.2, 1, 0.8 };
PdfCalRGBColor red = new PdfCalRGBColor(calRgbCS);
red.Red = 0;
PdfPen pen = new PdfPen(red);
PdfBrush brush = new PdfSolidBrush(red);
// Draw the rectangle
page.Graphics.DrawRectangle(pen, rect);
doc.Save("CalRedColorSpace.pdf");
' Create a new PDF document.
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
' Gets the graphics object.
Dim g As PdfGraphics = page.Graphics
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 14, PdfFontStyle.Bold)
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
' Creates RedColorSpace
Dim calRgbCS As PdfCalRGBColorSpace = New PdfCalRGBColorSpace()
calRgbCS.Gamma = New Double() { 1.6, 1.1, 2.5 }
calRgbCS.Matrix = New Double() { 1, 0, 0, 0, 1, 0, 0, 0, 1 }
calRgbCS.WhitePoint = New Double() { 0.2, 1, 0.8 }
Dim red As PdfCalRGBColor = New PdfCalRGBColor(calRgbCS)
red.Red = 0
Dim pen As PdfPen = New PdfPen(red)
Dim brush As PdfBrush = New PdfSolidBrush(red)
' Draw the rectangle
page.Graphics.DrawRectangle(pen, rect)
doc.Save("CalRedColorSpace.pdf")