BmpImage Constructor (String)
Initializes a new instance of the BmpImage class.

Namespace: Aspose.Imaging.FileFormats.Bmp
Assembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 21.04
Syntax
public BmpImage(
	string path
)

Parameters

path
Type: SystemString
The path to load image from and initialize pixel and palette data with.
Exceptions
ExceptionCondition
ArgumentNullExceptionraster image is null;rasterImage
BmpImageExceptionThe height should be positive.
ArgumentExceptionPalette should be specified for images with 8 bits per pixel or less.;palette
Examples
The example shows how to load a BmpImage from a file.
[C#]

string dir = "c:\\temp\\";

// Load a BMP image from a file.
// The source pixels will be converted to 32-bpp format if required.
using (Aspose.Imaging.FileFormats.Bmp.BmpImage bmpImage = new Aspose.Imaging.FileFormats.Bmp.BmpImage(dir + "sample.bmp"))
{
    // Do some image processing.
    // Save to another BMP file.
    bmpImage.Save(dir + "sample.output.32bpp.bmp");
}
See Also