Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active August 11, 2022 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/77eea2fa6129b23d80c4c0de9f13f2f6 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/77eea2fa6129b23d80c4c0de9f13f2f6 to your computer and use it in GitHub Desktop.

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