SetBitmapBits

The SetBitmapBits function sets the bits of color data for a bitmap to the specified values.

Note  The SetBitmapBits function is included only for compatibility with 16-bit versions of Windows. For Win32-based applications, use the SetDIBits function.

LONG SetBitmapBits(
  HBITMAP hbmp,        // handle to bitmap
  DWORD cBytes,        // number of bytes in bitmap array
  CONST VOID *lpBits   // address of array with bitmap bits
);
 

Parameters

hbmp
Handle to the bitmap to be set.
cBytes
Specifies the number of bytes pointed to by the lpBits parameter.
lpBits
Pointer to an array of bytes that contain color data for the specified bitmap.

Return Values

If the function succeeds, the return value is the number of bytes used in setting the bitmap bits.

If the function fails, the return value is zero.

Windows NT: To get extended error information, call GetLastError.

Remarks

The array identified by lpBits must be WORD aligned.

See Also

Bitmaps Overview, Bitmap Functions, GetBitmapBits, SetDIBits