Class PdfExtendedColor
Represents the extended color, based on a complex colorspace.
Inheritance
System.Object
PdfExtendedColor
Namespace: Syncfusion.Pdf.ColorSpace
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public abstract class PdfExtendedColor : Object
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 Gray ColorSpace
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)
' Create 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
PdfExtendedColor(PdfColorSpaces)
Initializes a new instance of the PdfExtendedColor class.
Declaration
public PdfExtendedColor(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, 100, 50);
// Create Gray ColorSpace
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")
Fields
m_colorspace
To store the Colorspace.
Declaration
protected PdfColorSpaces m_colorspace
Field Value
Type |
---|
PdfColorSpaces |
Properties
ColorSpace
Gets the Colorspace
Declaration
public PdfColorSpaces ColorSpace { get; }
Property Value
Type |
---|
PdfColorSpaces |
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 Gray ColorSpace
PdfCalGrayColorSpace calGrayCS = new PdfCalGrayColorSpace();
// Create new instance for PdfCalGrayColor
PdfCalGrayColor gray = new PdfCalGrayColor(calGrayCS);
gray.Gray = 0.2;
//Get the Color space.
PdfColorSpaces colorSpace = gray.ColorSpace;
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
'Get the Color space
Dim colorSpace As PdfColorSpaces = gray.ColorSpace
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")