[]
Represents a palette-color image with 8 bits per pixel.
public class Indexed8bppBitmap : IImage, IDisposable
Initializes a new instance of the Indexed8bppBitmap class.
public Indexed8bppBitmap(int pixelWidth, int pixelHeight, bool opaque, bool premultiplied = false, float dpiX = 96, float dpiY = 96)
pixelWidth
intThe width of the image, in pixels.
pixelHeight
intThe height of the image, in pixels.
opaque
boolIndicates whether the alpha channel should be ignored.
premultiplied
boolIndicates whether the color channels for all pixels are premultiplied by the alpha channel.
dpiX
floatThe horizontal dpi of the image.
dpiY
floatThe vertical dpi of the image.
Gets the associated lookup table with 256 Red-Green-Blue[-Alpha] palette entries.
public PaletteEntry[] ColorMap { get; }
Gets the horizontal dpi of the bitmap.
public float DpiX { get; }
Gets the vertical dpi of the bitmap.
public float DpiY { get; }
Gets or sets an instance of ExifProfile with Exif metadata of the image.
public ExifProfile ExifProfile { get; set; }
Gets or sets the raw ICC profile data.
public byte[] IccProfileData { get; set; }
Gets a value indicating whether the Indexed8bppBitmap has been disposed of.
public bool IsDisposed { get; }
Gets or sets a lookup table index (from 0 to 255) at the specified coordinates.
public int this[int x, int y] { get; set; }
x
intThe X coordinate.
y
intThe Y coordinate.
Gets or sets a value indicating whether the alpha channel of the image should be ignored.
public bool Opaque { get; set; }
Gets the pixel height of the image.
public int PixelHeight { get; }
Gets the pixel width of the image.
public int PixelWidth { get; }
Gets or sets a value indicating if the color channels for all pixels are premultiplied by the alpha channel.
public bool Premultiplied { get; set; }
Gets a pointer to the internal binary data.
public IntPtr RawData { get; }
Gets the flip and rotate transformations that must be applied to the image.
public FlipRotateAction Rotation { get; }
Applies a license key to an instance of Indexed8bppBitmap.
public void ApplyLicenseKey(string key)
key
stringThe license key to set.
Clears the Indexed8bppBitmap with the specified lookup table index (from 0 to 255).
public void Clear(int value, Rectangle rect)
value
intThe lookup table index (from 0 to 255) to fill the image.
rect
System.Drawing.RectangleThe target rectangle of the Indexed8bppBitmap.
Clears the Indexed8bppBitmap with the specified lookup table index (from 0 to 255).
public void Clear(int value)
value
intThe lookup table index (from 0 to 255) to fill the image.
Creates a new Indexed8bppBitmap with a fragment of the image.
public Indexed8bppBitmap Clip(Rectangle rect)
rect
System.Drawing.RectangleClipping rectangle of the source image to be extracted as a new Indexed8bppBitmap.
Creates a new Indexed8bppBitmap with a copy of the image.
public Indexed8bppBitmap Clone(bool cloneExif = false)
cloneExif
boolSpecifies whether the Exif metadata should be cloned (if exist), not just copied as a reference.
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)
allowSemitransparency
boolIndicates if the alpha channel supports values between 0 and 255 (if true), or the boundary values only (if false).
Clean up any resources being used.
public void Dispose()
Performs cleanup operations on managed and unmanaged resources.
protected virtual void Dispose(bool disposing)
disposing
boolPerforms cleanup operations on unmanaged resources.
protected ~Indexed8bppBitmap()
Changes the physical resolution of the image.
public void SetDpi(float dpiX, float dpiY)
dpiX
floatThe horizontal resolution.
dpiY
floatThe vertical resolution.
Changes the physical resolution of the image.
public void SetDpi(float dpi)
dpi
floatThe horizontal and vertical resolution.
Creates an instance of the GcBitmap class from the current Indexed8bppBitmap.
public GcBitmap ToGcBitmap()
Copies the image into an existing instance of GcBitmap.
public void ToGcBitmap(GcBitmap bmp, bool cloneExif)