Class PdfCalGrayColorSpace
- Namespace
- Syncfusion.Pdf.ColorSpace
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents a CalGray colorspace.
public class PdfCalGrayColorSpace : PdfColorSpaces
- Inheritance
-
PdfCalGrayColorSpace
- 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, 100, 50);
// Creates GrayColorSpace
PdfCalGrayColorSpace calGrayCS = new PdfCalGrayColorSpace();
// Create new instance for PdfCalGrayColor
PdfCalGrayColor gray = new PdfCalGrayColor(calGrayCS);
gray.Gray = 0.2;
PdfPen pen = new PdfPen(gray);
PdfBrush brush = new PdfSolidBrush(gray);
// Draws the rectangle
page.Graphics.DrawRectangle(pen, rect);
doc.Save("CalGrayColorSpace.pdf");
' Create a new PDF document.
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
Dim rect As RectangleF = New RectangleF(20, 70, 100, 50)
' Creates GrayColorSpace
Dim calGrayCS As PdfCalGrayColorSpace = New PdfCalGrayColorSpace()
' Create new instance for PdfCalGrayColor
Dim gray As PdfCalGrayColor = New PdfCalGrayColor(calGrayCS)
gray.Gray = 0.2
Dim pen As PdfPen = New PdfPen(gray)
Dim brush As PdfBrush = New PdfSolidBrush(gray)
' Draws the rectangle
page.Graphics.DrawRectangle(pen, rect)
doc.Save("CalGrayColorSpace.pdf")
Constructors
PdfCalGrayColorSpace()
Initializes a new instance of the PdfCalGrayColorSpace class.
public PdfCalGrayColorSpace()
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, 100, 50);
// Creates GrayColorSpace
PdfCalGrayColorSpace calGrayCS = new PdfCalGrayColorSpace();
// Create new instance for PdfCalGrayColor
PdfCalGrayColor gray = new PdfCalGrayColor(calGrayCS);
gray.Gray = 0.2;
PdfPen pen = new PdfPen(gray);
PdfBrush brush = new PdfSolidBrush(gray);
// Draws the rectangle
page.Graphics.DrawRectangle(pen, rect);
doc.Save("CalGrayColorSpace.pdf");
' Create a new PDF document.
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
Dim rect As RectangleF = New RectangleF(20, 70, 100, 50)
' Creates GrayColorSpace
Dim calGrayCS As PdfCalGrayColorSpace = New PdfCalGrayColorSpace()
' Create new instance for PdfCalGrayColor
Dim gray As PdfCalGrayColor = New PdfCalGrayColor(calGrayCS)
gray.Gray = 0.2
Dim pen As PdfPen = New PdfPen(gray)
Dim brush As PdfBrush = New PdfSolidBrush(gray)
' Draws the rectangle
page.Graphics.DrawRectangle(pen, rect)
doc.Save("CalGrayColorSpace.pdf")
- See Also
Properties
BlackPoint
Gets or sets the black point.
public double[] BlackPoint { get; set; }
Property Value
- double[]
An array of three numbers [XB YB ZB] specifying the tristimulus value, in the CIE 1931 XYZ space, of the diffuse black point. Default value: [ 0.0 0.0 0.0 ].
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, 100, 50);
// Create CalGraycolor space
PdfCalGrayColorSpace calGrayCS = new PdfCalGrayColorSpace();
calGrayCS.BlackPoint = new double[] { 0.2, 0.3, 0.8 };
// Create new instance for PdfCalGrayColor
PdfCalGrayColor red = new PdfCalGrayColor(calGrayCS);
red.Gray = 0.2;
PdfPen pen = new PdfPen(red);
PdfBrush brush = new PdfSolidBrush(red);
// Draws the rectangle
page.Graphics.DrawRectangle(pen, rect);
doc.Save("CalGrayColorSpace.pdf");
' Create a new PDF document.
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
Dim rect As RectangleF = New RectangleF(20, 70, 100, 50)
' Create CalGraycolor space
Dim calGrayCS As PdfCalGrayColorSpace = New PdfCalGrayColorSpace()
calGrayCS.BlackPoint = New Double() { 0.2, 0.3, 0.8 }
' Create new instance for PdfCalGrayColor
Dim red As PdfCalGrayColor = New PdfCalGrayColor(calGrayCS)
red.Gray = 0.2
Dim pen As PdfPen = New PdfPen(red)
Dim brush As PdfBrush = New PdfSolidBrush(red)
' Draws the rectangle
page.Graphics.DrawRectangle(pen, rect)
doc.Save("CalGrayColorSpace.pdf")
- See Also
Gamma
Gets or sets the gamma.
public double Gamma { get; set; }
Property Value
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, 100, 50);
// Creates gray color space
PdfCalGrayColorSpace calGrayCS = new PdfCalGrayColorSpace();
// Update color values
calGrayCS.Gamma = 0.7;
// Create new instance for PdfCalGrayColor
PdfCalGrayColor gray = new PdfCalGrayColor(calGrayCS);
gray.Gray = 0.2;
PdfPen pen = new PdfPen(gray);
PdfBrush brush = new PdfSolidBrush(gray);
// Draws the rectangle
page.Graphics.DrawRectangle(pen, rect);
doc.Save("CalGrayColorSpace.pdf");
' Create a new PDF document.
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
Dim rect As RectangleF = New RectangleF(20, 70, 100, 50)
' Creates gray color space
Dim calGrayCS As PdfCalGrayColorSpace = New PdfCalGrayColorSpace()
' Update color values
calGrayCS.Gamma = 0.7
' Create new instance for PdfCalGrayColor
Dim gray As PdfCalGrayColor = New PdfCalGrayColor(calGrayCS)
gray.Gray = 0.2
Dim pen As PdfPen = New PdfPen(gray)
Dim brush As PdfBrush = New PdfSolidBrush(gray)
' Draws the rectangle
page.Graphics.DrawRectangle(pen, rect)
doc.Save("CalGrayColorSpace.pdf")
- See Also
WhitePoint
Gets or sets the white point.
public double[] WhitePoint { get; set; }
Property Value
- double[]
An array of three numbers [XW YW ZW] specifying the tristimulus value, in the CIE 1931 XYZ space, of the diffuse white point. The numbers XW and ZW must be positive, and YW must be equal to 1.0.
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, 100, 50);
// Create CalGraycolor space
PdfCalGrayColorSpace calGrayCS = new PdfCalGrayColorSpace();
calGrayCS.WhitePoint = new double[] { 0.2, 1, 0.8 };
// Create new instance for PdfCalGrayColor
PdfCalGrayColor gray = new PdfCalGrayColor(calGrayCS);
gray.Gray = 0.2;
PdfPen pen = new PdfPen(gray);
PdfBrush brush = new PdfSolidBrush(gray);
// Draws the rectangle
page.Graphics.DrawRectangle(pen, rect);
doc.Save("CalGrayColorSpace.pdf");
' Create a new PDF document.
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
Dim rect As RectangleF = New RectangleF(20, 70, 100, 50)
' Create CalGraycolor space
Dim calGrayCS As PdfCalGrayColorSpace = New PdfCalGrayColorSpace()
calGrayCS.WhitePoint = New Double() { 0.2, 1, 0.8 }
' Create new instance for PdfCalGrayColor
Dim gray As PdfCalGrayColor = New PdfCalGrayColor(calGrayCS)
gray.Gray = 0.2
Dim pen As PdfPen = New PdfPen(gray)
Dim brush As PdfBrush = New PdfSolidBrush(gray)
' Draws the rectangle
page.Graphics.DrawRectangle(pen, rect)
doc.Save("CalGrayColorSpace.pdf")
- See Also