Bitmap Constructor (String)

Bitmap Constructor (String)


Initializes a new instance of the Bitmap class from the specified file.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

public Bitmap(
	string filename


Type: System.String

The bitmap file name and path.

Exception Condition

The specified file is not found.

The file name and path can be relative to the application or an absolute path. Use this constructor to open images with the following file formats: BMP, GIF, EXIF, JPG, PNG and TIFF. For more information about supported formats, see Types of Bitmaps. The file remains locked until the Bitmap is disposed.

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft