Bitmap.Bitmap(Int32, Int32, Int32, PixelFormat, IntPtr) Constructor

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

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

Bitmap (
	int width, 
	int height, 
	int stride, 
	PixelFormat format, 
	IntPtr scan0
public Bitmap (
	int width, 
	int height, 
	int stride, 
	PixelFormat format, 
	IntPtr scan0
public function Bitmap (
	width : int, 
	height : int, 
	stride : int, 
	format : PixelFormat, 
	scan0 : IntPtr
Not applicable.



The width, in pixels, of the new Bitmap.


The height, in pixels, of the new Bitmap.


Integer that specifies the byte offset between the beginning of one scan line and the next. This is usually (but not necessarily) the number of bytes in the pixel format (for example, 2 for 16 bits per pixel) multiplied by the width of the bitmap. The value passed to this parameter must be a multiple of four..


The PixelFormat enumeration for the new Bitmap.


Pointer to an array of bytes that contains the pixel data.

The caller is responsible for allocating and freeing the block of memory specified by the scan0 parameter, however, the memory should not be released until the related Bitmap is released.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0