Enum BitmapCompression

Enum BitmapCompression

Namespace: Aspose.Imaging.FileFormats.Bmp
Assembly: Aspose.Imaging.dll (25.7.0)

Specifies different bitmap compression methods.

public enum BitmapCompression
{
    RLE8 = 1,
    RGB565 = 2,
    BI_BITFIELDS = 3,
    BI_RLE8 = 40,
    BI_BITFIELD = 45,
    JPEG = 65536,
    PNG = 137849562,
    TIFF_MM_TETRONON = 20002,
    TIFF_MM_TEDInfo = 20003,
    TIFF_MM_JPEG = 20016,
    WBMP = 75898,
    WDP = 4216135319
}

Fields

AlphaBitfields = 6

RGBA bit fields. Can be used only with 16 and 32-bit/pixel bitmaps.

Bitfields = 3

RGB bit fields. Can be used only with 16 and 32-bit/pixel bitmaps.

Dxt1 = 827611204

DXT1 compression. The bitmap contains a texture.

Jpeg = 4

JPEG compression. The bitmap contains a JPEG image.

Png = 5

PNG compression. The bitmap contains a PNG image.

Rgb = 0

No compression.

Rle4 = 2

RLE 4-bit/pixel compression. Can be used only with 4-bit/pixel bitmaps.

Rle8 = 1

RLE 8-bit/pixel compression. Can be used only with 8-bit/pixel bitmaps.

Examples

The example shows how to export a BmpImage with the Rgb compression type.

string sourcePath = "input.png";
   using (Image pngImage = Image.Load(sourcePath))
   {
       pngImage.Save(outputPath, new BmpOptions() { Compression = BitmapCompression.Rgb });
   }

The example shows how to export a BmpImage from a Png file while keeping the alpha channel, save a Bmp file with transparency.

string sourcePath = "input.png";
   using (Image pngImage = Image.Load(sourcePath))
   {
       pngImage.Save(outputPath);
       pngImage.Save(outputPath, new BmpOptions());
       pngImage.Save(outputPath, new BmpOptions() { Compression = BitmapCompression.Bitfields });
   }
 English