Enum BitmapCompression
Nombre del espacio: Aspose.Imaging.FileFormats.Bmp Asamblea: Aspose.Imaging.dll (25.4.0)
Especifica diferentes métodos de compresión de bitmap.
public enum BitmapCompression : uint
Fields
AlphaBitfields = 6
Se puede utilizar sólo con 16 y 32 bits/pixel bitmaps.
Bitfields = 3
Los campos de RGB pueden utilizarse solo con 16 y 32 bits/pixel.
Dxt1 = 827611204
Compresión DXT1. el bitmap contiene una textura.
Jpeg = 4
Compresión JPEG. El bitmap contiene una imagen JPEG.
Png = 5
Compresión PNG. El bitmap contiene una imagen PNG.
Rgb = 0
No hay compresión.
Rle4 = 2
RLE 4 bits/pixel compresión. se puede utilizar sólo con 4 bits/pixel bitmaps.
Rle8 = 1
Compresión de 8 bits/pixel. se puede utilizar sólo con 8 bits/pixel bitmaps.
Examples
El ejemplo muestra cómo exportar un BmpImage con el tipo de compresión Rgb.
string sourcePath = "input.png";
// Load a PNG image from a file.
using (Image pngImage = Image.Load(sourcePath))
{
// BMP image is saved with transparency support by default, that is achieved by using the BitmapCompression.Bitfields compression method.
// To save a BMP image with the Rgb compression method, the BmpOptions with the Compression property set to BitmapCompression.Rgb should be specified.
pngImage.Save(outputPath, new BmpOptions() { Compression = BitmapCompression.Rgb });
}
El ejemplo muestra cómo exportar un BmpImage de un archivo Png mientras se mantiene el canal alfa, guardando un archivo Bmp con transparencia.
string sourcePath = "input.png";
// Load a PNG image from a file.
using (Image pngImage = Image.Load(sourcePath))
{
// BMP image is saved with transparency support by default.
// If you want to explicitly specify such mode, the BmpOptions's Compression property should be set to BitmapCompression.Bitfields.
// The BitmapCompression.Bitfields compression method is the default compression method in the BmpOptions.
// So the same result of exporting a Bmp image with transparency can be achieved by either one of the following ways.
// With an implicit default options:
pngImage.Save(outputPath);
// With an explicit default options:
pngImage.Save(outputPath, new BmpOptions());
// Specifying the BitmapCompression.Bitfields compression method:
pngImage.Save(outputPath, new BmpOptions() { Compression = BitmapCompression.Bitfields });
}