Bitmap.PixelFormat Property

Gets a pixel format of the current bitmap.

Namespace: Aurigma.GraphicsMill
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public PixelFormat PixelFormat { get; }

Property Value

A PixelFormat of the current bitmap.

Remarks

You can use the following properties to get more detailed information about current pixel format:

Property Description
ColorSpace Color space of pixels represented with current pixel format.
HasAlpha Whether current pixel format supports alpha channel (transparency information).
IsCmyk Whether color space of pixels represented with current pixel format is CMYK.
IsRgb Whether color space of pixels represented with current pixel format is RGB.
IsGrayscale Whether color space of pixels represented with current pixel format is grayscale.
IsExtended Whether current pixel format is extended (16 bits per channel).
IsIndexed Whether current pixel format is indexed (palette-based).

Examples

C#
Console.WriteLine("Bitmap: " + bitmap.Width + "x" + bitmap.Height);
Console.WriteLine("  Has Aplha: " + bitmap.HasAlpha);
Console.WriteLine("  PixelFormat: " + bitmap.PixelFormat.ToString());
Console.WriteLine("  CMYK: " + bitmap.PixelFormat.IsCmyk);
Console.WriteLine("  GrayScale: " + bitmap.PixelFormat.IsGrayscale);
Console.WriteLine("  RGB: " + bitmap.PixelFormat.IsRgb);
Console.WriteLine("  Indexed: " + bitmap.PixelFormat.IsIndexed);
Console.WriteLine("  Extended: " + bitmap.PixelFormat.IsExtended);

See Also

Reference