Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Aspose.Imaging .NET API allows to easy manipulate your bmp images or photos in your .NET application or Web service.

You can:

  • Convert bmp image to raster formats;
  • Create bmp image;
  • Convert bmp image to vector formats;
  • Compress bmp images;
  • Operate with transparent bmp images;
  • Perform crop,rotate,resize and other typical operations to bmp images.

Interested ?

You may go further at : https://products.aspose.com/imaging/net/

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");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment