Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library
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.


Windows Mobile 6.5
A version of this page is also available for

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

LONG SetBitmapBits(
  HBITMAP hbmp,
  DWORD cBytes,
  CONST VOID *lpBits


[in] Handle to the bitmap to be set.

This must be a compatible bitmap.


[in] Specifies the number of bytes pointed to by the lpBits parameter.


[in] Pointer to an array of bytes that contain color data for the specified bitmap.

If successful, the function returns the number of bytes used in setting the bitmap bits.

If the function fails, it returns zero.

To get extended error information, call GetLastError.

The array identified by lpBits must be word aligned.

Windows Embedded CEWindows CE .NET 4.1 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions

© 2015 Microsoft