Bitmap.Bitmap

Bitmap(string)

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

public Bitmap(string filename)
ParameterTypeDescription
filenameStringThe name of the bitmap file.

See Also


Bitmap(string, bool)

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

public Bitmap(string filename, bool useIcm)
ParameterTypeDescription
filenameStringThe name of the bitmap file.
useIcmBooleantrue to use color correction for this Bitmap; otherwise, false.

See Also


Bitmap(Stream)

Initializes a new instance of the Bitmap class from the specified data stream.

public Bitmap(Stream stream)
ParameterTypeDescription
streamStreamThe data stream used to load the image.

Exceptions

exceptioncondition
ArgumentExceptionstream does not contain image data or is null.-or-stream contains a PNG image file with a single dimension greater than 65,535 pixels.

See Also


Bitmap(Stream, bool)

Initializes a new instance of the Bitmap class from the specified data stream.

public Bitmap(Stream stream, bool useIcm)
ParameterTypeDescription
streamStreamThe data stream used to load the image.
useIcmBooleantrue to use color correction for this Bitmap; otherwise, false.

Exceptions

exceptioncondition
ArgumentExceptionstream does not contain image data or is null.-or-stream contains a PNG image file with a single dimension greater than 65,535 pixels.

See Also


Bitmap(int, int, PixelFormat)

Initializes a new instance of the Bitmap class with the specified size and format.

public Bitmap(int width, int height, PixelFormat format)
ParameterTypeDescription
widthInt32The width, in pixels, of the new Bitmap.
heightInt32The height, in pixels, of the new Bitmap.
formatPixelFormatThe PixelFormat enumeration for the new Bitmap.

See Also


Bitmap(int, int)

Initializes a new instance of the Bitmap class with the specified size.

public Bitmap(int width, int height)
ParameterTypeDescription
widthInt32The width, in pixels, of the new Bitmap.
heightInt32The height, in pixels, of the new Bitmap.

Exceptions

exceptioncondition
ExceptionThe operation failed.

See Also


Bitmap(Bitmap)

Initializes a new instance of the Bitmap class from the specified existing image.

public Bitmap(Bitmap original)
ParameterTypeDescription
originalBitmapThe Image from which to create the new Bitmap.

See Also


Bitmap(Bitmap, int, int)

Initializes a new instance of the Bitmap class from the specified existing image, scaled to the specified size.

public Bitmap(Bitmap original, int width, int height)
ParameterTypeDescription
originalBitmapThe Image from which to create the new Bitmap.
widthInt32The width, in pixels, of the new Bitmap.
heightInt32The height, in pixels, of the new Bitmap.

Exceptions

exceptioncondition
ExceptionThe operation failed.

See Also


Bitmap(Bitmap, Size)

Initializes a new instance of the Bitmap class from the specified existing image, scaled to the specified size.

public Bitmap(Bitmap original, Size newSize)
ParameterTypeDescription
originalBitmapThe Image from which to create the new Bitmap.
newSizeSizeThe Size structure that represent the size of the new Bitmap.

Exceptions

exceptioncondition
ExceptionThe operation failed.

See Also