Bitmap::Bitmap method

Creates a Bitmap::Bitmap object based on an array of bytes along with size and format information.

Syntax

void Bitmap(
  INT         width,
  INT         height,
  INT         stride,
  PixelFormat format,
  BYTE        *scan0
);

Parameters

width

Type: INT

Integer that specifies the width, in pixels, of the bitmap.

height

Type: INT

Integer that specifies the height, in pixels, of the bitmap.

stride

Type: INT

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.

format

Type: PixelFormat

Integer that specifies the pixel format of the bitmap. The PixelFormat data type and constants that represent various pixel formats are defined in Gdipluspixelformats.h. For more information about pixel format constants, see Image Pixel Format Constants.

scan0

Type: BYTE*

Pointer to an array of bytes that contains the pixel data. The caller is responsible for allocating and freeing the block of memory pointed to by this parameter.

Return Value

None

Requirements

   
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusheaders.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See Also

Bitmap

Bitmap Constructors

Image

Image Pixel Format Constants

Images, Bitmaps, and Metafiles

Using Images, Bitmaps, and Metafiles