Enum BitmapCompression

Enum BitmapCompression

نام ها : Aspose.Imaging.FileFormats.Bmp جمع آوری: Aspose.Imaging.dll (25.4.0)

روش های مختلف فشرده سازی بیت مپ را مشخص می کند.

public enum BitmapCompression : uint

Fields

AlphaBitfields = 6

RGBA بیتی می تواند تنها با 16 و 32 بیتی / پیکسل bitmaps استفاده می شود.

Bitfields = 3

میدان های بیت RGB را می توان با 16 و 32 بیتی / پیکسل بیت مپ استفاده کرد.

Dxt1 = 827611204

DXT1 فشرده سازی.Bitmap حاوی یک متن است.

Jpeg = 4

فشرده سازی JPEG: این بیت مپ شامل یک تصویر JPEG است.

Png = 5

فشرده سازی PNG: بیت مپ حاوی یک تصویر PNG است.

Rgb = 0

بدون فشرده سازی

Rle4 = 2

RLE 4 بیتی / پیکسل فشرده سازی. می تواند تنها با 4 بیتی / پیکسل bitmaps استفاده می شود.

Rle8 = 1

RLE 8 بیتی / پیکسل فشرده سازی. می تواند تنها با 8 بیتی / پیکسل bitmaps استفاده می شود.

Examples

نمونه نشان می دهد که چگونه یک BmpImage را با نوع فشرده سازی 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 });
                                                                                    }

مثال نشان می دهد که چگونه یک BmpImage از یک فایل Png در حالی که نگه داشتن کانال آلفا، ذخیره یک فایل 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 });
                                                                                                                                         }
 فارسی