[]
        
(Showing Draft Content)

GrapeCity.Documents.Imaging.Indexed4bppBitmap

Class Indexed4bppBitmap

Namespace
GrapeCity.Documents.Imaging
Assembly
GcDocs.Imaging.dll

Represents a palette-color image with 4 bits per pixel.

public class Indexed4bppBitmap : IImage, IDisposable
Inheritance
object
Indexed4bppBitmap
Implements
System.IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

Indexed4bppBitmap(int, int, bool, bool, bool, float, float)

Initializes a new instance of the Indexed4bppBitmap class.

public Indexed4bppBitmap(int pixelWidth, int pixelHeight, bool opaque, bool premultiplied = false, bool lowerBitsFirst = false, float dpiX = 96, float dpiY = 96)

Parameters

pixelWidth int

The width of the image, in pixels.

pixelHeight int

The height of the image, in pixels.

opaque bool

Indicates whether the alpha channel should be ignored.

premultiplied bool

Indicates whether the color channels for all pixels are premultiplied by the alpha channel.

lowerBitsFirst bool

If true, pixels are arranged within a byte such that pixels with lower column indices are stored in the lower-order bit tetrads of the byte.

dpiX float

The horizontal dpi of the image.

dpiY float

The vertical dpi of the image.

Properties

ColorMap

Gets the associated lookup table with 16 Red-Green-Blue[-Alpha] palette entries.

public PaletteEntry[] ColorMap { get; }

Property Value

PaletteEntry[]

DpiX

Gets the horizontal dpi of the bitmap.

public float DpiX { get; }

Property Value

float

DpiY

Gets the vertical dpi of the bitmap.

public float DpiY { get; }

Property Value

float

ExifProfile

Gets or sets an instance of ExifProfile with Exif metadata of the image.

public ExifProfile ExifProfile { get; set; }

Property Value

ExifProfile

IccProfileData

Gets or sets the raw ICC profile data.

public byte[] IccProfileData { get; set; }

Property Value

byte[]

IsDisposed

Gets a value indicating whether the Indexed4bppBitmap has been disposed of.

public bool IsDisposed { get; }

Property Value

bool

this[int, int]

Gets or sets a lookup table index (from 0 to 15) at the specified coordinates.

public int this[int x, int y] { get; set; }

Parameters

x int

The X coordinate.

y int

The Y coordinate.

Property Value

int

LowerBitsFirst

Gets or sets a value specifying whether pixels with lower column indices are stored in the lower-order bit tetrads of the byte.

Setting this property causes an update to the pixel data.

public bool LowerBitsFirst { get; set; }

Property Value

bool

Opaque

Gets or sets a value indicating whether the alpha channel of the image should be ignored.

public bool Opaque { get; set; }

Property Value

bool

PixelHeight

Gets the pixel height of the image.

public int PixelHeight { get; }

Property Value

int

PixelWidth

Gets the pixel width of the image.

public int PixelWidth { get; }

Property Value

int

Premultiplied

Gets or sets a value indicating if the color channels for all pixels are premultiplied by the alpha channel.

public bool Premultiplied { get; set; }

Property Value

bool

RawData

Gets a pointer to the internal binary data.

public IntPtr RawData { get; }

Property Value

System.IntPtr

Rotation

Gets the flip and rotate transformations that must be applied to the image.

public FlipRotateAction Rotation { get; }

Property Value

FlipRotateAction

ScanLineLength

Gets the number of bytes in one scan line.

public int ScanLineLength { get; }

Property Value

int

Methods

ApplyLicenseKey(string)

Applies a license key to an instance of Indexed4bppBitmap.

public void ApplyLicenseKey(string key)

Parameters

key string

The license key to set.

Clear(int, Rectangle)

Clears the Indexed4bppBitmap with the specified lookup table index (from 0 to 15).

public void Clear(int value, Rectangle rect)

Parameters

value int

The lookup table index (from 0 to 15) to fill the image.

rect System.Drawing.Rectangle

The target rectangle of the Indexed4bppBitmap.

Clear(int)

Clears the Indexed4bppBitmap with the specified lookup table index (from 0 to 15).

public void Clear(int value)

Parameters

value int

The lookup table index (from 0 to 15) to fill the image.

Clip(Rectangle)

Creates a new Indexed4bppBitmap with a fragment of the image.

public Indexed4bppBitmap Clip(Rectangle rect)

Parameters

rect System.Drawing.Rectangle

Clipping rectangle of the source image to be extracted as a new Indexed4bppBitmap.

Returns

Indexed4bppBitmap

Clone(bool)

Creates a new Indexed4bppBitmap with a copy of the image.

public Indexed4bppBitmap Clone(bool cloneExif = false)

Parameters

cloneExif bool

Specifies whether the Exif metadata should be cloned (if exist), not just copied as a reference.

Returns

Indexed4bppBitmap

CompactPalette(bool)

Compacts the image palette to 8 bits per color channel and returns the palette as an array of 32-bit ARGB values.

public uint[] CompactPalette(bool allowSemitransparency = false)

Parameters

allowSemitransparency bool

Indicates if the alpha channel supports values between 0 and 255 (if true), or the boundary values only (if false).

Returns

uint[]

Dispose()

Clean up any resources being used.

public void Dispose()

Dispose(bool)

Performs cleanup operations on managed and unmanaged resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

~Indexed4bppBitmap()

Performs cleanup operations on unmanaged resources.

protected ~Indexed4bppBitmap()

SetDpi(float, float)

Changes the physical resolution of the image.

public void SetDpi(float dpiX, float dpiY)

Parameters

dpiX float

The horizontal resolution.

dpiY float

The vertical resolution.

SetDpi(float)

Changes the physical resolution of the image.

public void SetDpi(float dpi)

Parameters

dpi float

The horizontal and vertical resolution.

ToGcBitmap()

Creates an instance of the GcBitmap class from the current Indexed4bppBitmap.

public GcBitmap ToGcBitmap()

Returns

GcBitmap

A new instance of the GcBitmap class.

ToGcBitmap(GcBitmap, bool)

Copies the image into an existing instance of GcBitmap.

public void ToGcBitmap(GcBitmap bmp, bool cloneExif)

Parameters

bmp GcBitmap

The target GcBitmap object.

cloneExif bool

Specifies whether the Exif metadata should be cloned (if exist), not just copied as a reference.