Class PdfCalRGBColor
- Namespace
- Syncfusion.Pdf.ColorSpace
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents a calibrated RGB color, based on a CalRGB colorspace.
public class PdfCalRGBColor : PdfExtendedColor
- Inheritance
-
PdfCalRGBColor
- Inherited Members
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.
public PdfCalRGBColor(PdfColorSpaces colorspace)
Parameters
colorspace
PdfColorSpacesThe 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.
public double Blue { get; set; }
Property Value
- double
The blue level of this 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.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")
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.
- See Also
Green
Gets or sets the green level for this color.
public double Green { get; set; }
Property Value
- double
The green level of this 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")
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.
- See Also
Red
Gets or sets the red level for this color.
public double Red { get; set; }
Property Value
- double
The red level of this 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")
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.
- See Also