menu

Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfCalRGBColor - Xamarin.Android API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfCalRGBColor

    Represents a calibrated RGB color, based on a CalRGB colorspace.

    Inheritance
    System.Object
    PdfExtendedColor
    PdfCalRGBColor
    Inherited Members
    PdfExtendedColor.ColorSpace
    PdfExtendedColor.m_colorspace
    Namespace: Syncfusion.Pdf.ColorSpace
    Assembly: Syncfusion.Pdf.Portable.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
    PdfExtendedColor
    PdfCalRGBColorSpace
    PdfPen
    PdfColorSpaces

    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
    PdfExtendedColor
    PdfCalRGBColorSpace
    PdfPen
    PdfColorSpaces

    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
    PdfExtendedColor
    PdfCalRGBColorSpace
    PdfPen
    PdfColorSpaces

    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")
    See Also
    PdfExtendedColor
    PdfCalRGBColorSpace
    PdfPen
    PdfColorSpaces

    See Also

    PdfExtendedColor
    PdfCalRGBColorSpace
    PdfPen
    PdfColorSpaces
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved