View BMP images via C#
Build your own .NET apps to View BMP image files using server-side APIs
How to View BMP images Using C#
We often receive images in less common formats as source materials. For subsequent viewing of such images, special programs are required. In order not to think about this problem and use the time to solve the issue for more creative tasks, use the functions of the C# graphic library. By converting such images to files of more popular formats, you can open them in the standard image viewing program for your platform. In order to view BMP files, we’ll use Aspose.Imaging for .NET API which is a feature-rich, powerful and easy to use image manipulation and conversion API for C# platform. Open NuGet package manager, search for Aspose.Imaging and install. You may also use the following command from the Package Manager Console.
Package Manager Console Command
PM> Install-Package Aspose.Imaging
Steps to View BMP via C#
You need the aspose.imaging.dll to try the following workflow in your own environment.
- load BMP files with Image.Load method;
- create image view;
- save new image to disc in the supported by Aspose.Imaging format.
System Requirements
Aspose.Imaging for .NET is supported on all major operating systems. Just make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with .NET Framework, .NET Core, Windows Application, ASP.NET Web Application.
- Development environment like Microsoft Visual Studio.
- Aspose.Imaging for .NET referenced in your project.
Free App to View BMP
- Select or drag and drop an BMP image
- Image will be automatically uploaded and shown
Check our live demos to view BMP
View BMP images - .NET
using Aspose.Imaging; | |
using System; | |
using System.IO; | |
using System.Text; | |
using System.Collections.Generic; | |
//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip | |
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder | |
string templatesFolder = @"c:\Users\USER\Downloads\templates\"; | |
// Load the bmp file in an instance of Image | |
using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.bmp"))) | |
{ | |
// Create an instance of PngOptions | |
var exportOptions = new Aspose.Imaging.ImageOptions.PngOptions(){ ColorType = Aspose.Imaging.FileFormats.Png.PngColorType.TruecolorWithAlpha}; | |
// Save bmp to png | |
image.Save(Path.Combine(templatesFolder, "output.png"), exportOptions); | |
File.Delete(Path.Combine(templatesFolder, "output.png")); | |
} |
About Aspose.Imaging for .NET API
Aspose.Imaging API is an image processing solution to create, modify, draw or convert images (photos) within applications. It offers: cross-platform Image processing, including but not limited to conversions between various image formats (including uniform multi-page or multi-frame image processing), modifications such as drawing, working with graphic primitives, transformations (resize, crop, flip&rotate, binarization, grayscale, adjust), advanced image manipulation features (filtering, dithering, masking, deskewing), and memory optimization strategies. It’s a standalone library and does not depend on any software for image operations. One can easily add high-performance image conversion features with native APIs within projects. These are 100% private on-premise APIs and images are processed at your servers.BMP What is BMP File Format
Files having extension .BMP represent Bitmap Image files that are used to store bitmap digital images. These images are independent of graphics adapter and are also called device independent bitmap (DIB) file format. This independency serves the purpose of opening the file on multiple platforms such as Microsoft Windows and Mac. The BMP file format can store data as two-dimensional digital images in both monochrome as well as color format with various colour depths.
Read MoreOther Supported View Formats
Using C#, one can easily View different formats including: