Enum BitmapCompression
Enum BitmapCompression
이름 공간 : Aspose.Imaging.FileFormats.Bmp 모임: Aspose.Imaging.dll (25.4.0)
다른 bitmap 압축 방법을 지정합니다.
public enum BitmapCompression : uint
Fields
AlphaBitfields = 6
RGBA 비트 필드. 16 및 32 비트 / 픽셀 비트 맵으로만 사용할 수 있습니다.
Bitfields = 3
RGB 비트 필드. 16 및 32 비트 / 픽셀 비트 맵과 함께만 사용할 수 있습니다.
Dxt1 = 827611204
DXT1 압축. bitmap에는 텍스트가 포함되어 있습니다.
Jpeg = 4
JPEG 압축. bitmap에는 JPEG 이미지가 포함되어 있습니다.
Png = 5
PNG 압축. bitmap에는 PNG 이미지가 포함되어 있습니다.
Rgb = 0
압축이 없습니다
Rle4 = 2
RLE 4 비트 / 픽셀 압축. 4 비트 / 픽셀 비트 매프와 함께만 사용할 수 있습니다.
Rle8 = 1
RLE 8bit/pixel 압축. 8bit/pixel bitmaps에서만 사용할 수 있습니다.
Examples
예제는 Rgb 압축 유형을 사용하여 BmpImage를 수출하는 방법을 보여줍니다.
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 });
}
예제는 알파 채널을 유지하는 동안 Png 파일에서 BmpImage를 수출하는 방법을 보여주며, Bmp 파일을 투명하게 저장합니다.
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 });
}