CreateIcon (USER32.@)
HICON CreateIcon ( HINSTANCE hInstance, INT nWidth, INT nHeight, BYTE bPlanes, BYTE bBitsPixel, LPCVOID lpANDbits, LPCVOID lpXORbits )
hInstance | [In] | the application's hInstance. |
nWidth | [In] | the width of the provided bitmaps. |
nHeight | [In] | the height of the provided bitmaps. |
bPlanes | [In] | the number of planes in the provided bitmaps. |
bBitsPixel | [In] | the number of bits per pixel of the lpXORbits bitmap. |
lpANDbits | [In] | a monochrome bitmap representing the icon's mask. |
lpXORbits | [In] | the icon's 'color' bitmap. |
Creates an icon based on the specified bitmaps. The bitmaps must be provided in a device dependent format and will be resized to (SM_CXICON,SM_CYICON) and depth converted to match the screen's color depth. The provided bitmaps must be top-down bitmaps. Although Windows® does not support 15bpp(*) this Api must support it for Winelib applications.
(*) Windows® does not support 15bpp but it supports the 555 RGB 16bpp format!.
Success: handle to an icon
Failure: NULL.
- The provided bitmaps are not resized!
- The documentation says the lpXORbits bitmap must be in a device dependent format. But we must still resize it and perform depth conversions if necessary.
- I'm a bit unsure about the how the 'device dependent format' thing works. I did some tests on Windows® and found that if you provide a 16bpp bitmap in lpXORbits, then its format but be 565 RGB if the screen's bit depth is 16bpp but it must be 555 RGB if the screen's bit depth is anything else. I don't know if this is part of the GDI specs or if this is a quirk of the graphics card driver.
- You may think that we check whether the bit depths match or not as an optimization. But the truth is that the conversion using CreateDIBitmap does not work for some bit depth (e.g. 8bpp) and I have no idea why.
- I'm pretty sure that all the things we do in CreateIcon should also be done in CreateIconIndirect...
Defined in "winuser.h".
Implemented in "dlls/user/cursoricon.c". source.winehq.org/source/dlls/user/cursoricon.c
Debug channel "cursor".
Copyright © 2006 The Wine Project. All trademarks are the property of their respective owners. Visit WineHQ for license details. Generated Oct 2006.