The SetDIBits function sets the pixels in a bitmap using the color data found in the specified device-independent bitmap (DIB).
int SetDIBits(
HDC hdc, |
// handle of device context |
HBITMAP hbmp, |
// handle of bitmap |
UINT uStartScan, |
// starting scan line |
UINT cScanLines, |
// number of scan lines |
CONST VOID *lpvBits, |
// array of bitmap bits |
CONST BITMAPINFO *lpbmi, |
// address of structure with bitmap data |
UINT fuColorUse |
// type of color indices to use |
); |
Value |
Meaning |
DIB_PAL_COLORS |
The color table consists of an array of 16-bit indices into the logical palette of the device context identified by the hdc parameter. |
DIB_RGB_COLORS |
The color table is provided and contains literal RGB values. |
If the function succeeds, the return value is the number of scan lines copied.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Optimal bitmap drawing speed is obtained when the bitmap bits are indices into the system palette.
Applications can retrieve the system palette colors and indices by calling the GetSystemPaletteEntries function. After the colors and indices are retrieved, the application can create the DIB. For more information, see System Palette.
The device context identified by the hdc parameter is used only if the DIB_PAL_COLORS constant is set for the fuColorUse parameter; otherwise it is ignored.
The bitmap identified by the hbmp parameter must not be selected into a device context when the application calls this function.
The origin for bottom-up DIBs is the lower-left corner of the bitmap; the origin for top-down DIBs is the upper-left corner of the bitmap.
GetDIBits, GetSystemPaletteEntries, BITMAPINFO
See:
file: /Techref/os/win/api/win32/func/src/f78_4.htm, 5KB, , updated: 2001/6/26 10:22, local time: 2024/11/25 11:30,
3.147.68.201:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/Techref/os/win/api/win32/func/src/f78_4.htm"> SetDIBits</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.