Manipulating Bmp Files
Contents
[
Hide
]
Aspose.Imaging for .NET supports the Bmp format, including compressed RLE bmp.
Converting compressed BMP RLE4
Both loading and saving of the Rle4 compressed Bmp images are supported.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Imaging; | |
using Aspose.Imaging.FileFormats.Bmp; | |
using Aspose.Imaging.FileFormats.Png; | |
using Aspose.Imaging.FileFormats.Svg; | |
using Aspose.Imaging.ImageOptions; | |
using System; | |
using System.IO; | |
string templatesFolder = @"c:\Users\USER\Downloads\templates\"; | |
string dataDir = templatesFolder; | |
using (Image image = Image.Load(dataDir + "template.bmp")) | |
{ | |
image.Save( | |
dataDir + "result.bmp", | |
new BmpOptions() | |
{ | |
Compression = BitmapCompression.Rle4, | |
BitsPerPixel = 4, | |
Palette = ColorPaletteHelper.Create4Bit() | |
}); | |
} | |
File.Delete(dataDir + "result.bmp"); |