Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Bitmap.Bitmap(INT, INT, INT, PixelFormat, BYTE*) constructor

Applies to: desktop apps only

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

Syntax

Bitmap(
  [in]  INT width,
  [in]  INT height,
  [in]  INT stride,
  [in]  PixelFormat format,
  [in]  BYTE *scan0
);

Parameters

width [in]

Type: INT

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

height [in]

Type: INT

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

stride [in]

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 [in]

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 [in]

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.

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusheaders.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Bitmap
Bitmap Constructors
Image
Image Pixel Format Constants
Using Images, Bitmaps, and Metafiles
Images, Bitmaps, and Metafiles

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

Show:
© 2015 Microsoft