Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than gdi32, prefix the name with the module name and a period.
SetBitmapBits (gdi32)
.
Windows GDI
SetBitmapBits
SetBitmapBits (gdi32)
Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than gdi32, prefix the name with the module name and a period.
.
Summary The SetBitmapBits API
The SetBitmapBits function sets the bits of color data for a bitmap to the specified values.
C# Signature:
[DllImport("gdi32.dll")]
static extern int SetBitmapBits(IntPtr hbmp, uint cBytes, byte [] lpBits);
Note This function is provided only for compatibility with 16-bit versions of Windows. Applications should use the SetDIBits function.
User-Defined Types:
None.
LONG SetBitmapBits(
HBITMAP hbmp, // handle to bitmap
DWORD cBytes, // number of bytes in bitmap array
CONST VOID *lpBits // array with bitmap bits
);
Notes:
None.
Parameters
Tips & Tricks:
Please add some!
hbmp
[in] Handle to the bitmap to be set. This must be a compatible bitmap (DDB).
cBytes
[in] Specifies the number of bytes pointed to by the lpBits parameter.
lpBits
[in] Pointer to an array of bytes that contain color data for the specified bitmap.
Sample Code:
Please add some!
Return Values
Alternative Managed API:
Do you know one? Please contribute it!
If the function succeeds, the return value is the number of bytes used in setting the bitmap bits.
Documentation SetBitmapBits on MSDN
If the function fails, the return value is zero.
Windows NT/2000/XP: To get extended error information, call GetLastError.
Remarks
The array identified by lpBits must be WORD aligned.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Wingdi.h; include Windows.h.
Library: Use Gdi32.lib.
See Also
Bitmaps Overview, Bitmap Functions, GetBitmapBits, SetDIBits
Click to read this page8/16/2008 5:31:09 AM - -203.81.197.27
Click to read this page8/16/2008 5:31:09 AM - -203.81.197.27
Click to read this page8/16/2008 5:31:09 AM - -203.81.197.27
Click to read this page8/16/2008 5:31:09 AM - -203.81.197.27
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 4:00:13 AM - Damon Carr-72.43.165.29
The SetDIBitsToDevice API
7/15/2014 12:51:48 PM - radoslaw@zawartko.com-79.175.204.58
The SetDIBitsToDevice API
7/15/2014 12:51:48 PM - radoslaw@zawartko.com-79.175.204.58
Please edit this page!
Do you have...
- helpful tips or sample code to share for using this API in managed code?
- corrections to the existing content?
- variations of the signature you want to share?
- additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).
