Match behaviour of ImageList_LoadImageA wrt cx parameter (when set to

zero).
This commit is contained in:
Sander van Leeuwen 2002-05-30 20:38:13 +00:00 committed by Alexandre Julliard
parent c97e24e08c
commit 9851f7a902
1 changed files with 13 additions and 0 deletions

View File

@ -1907,6 +1907,19 @@ ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow,
if (uType == IMAGE_BITMAP) { if (uType == IMAGE_BITMAP) {
BITMAP bmp; BITMAP bmp;
GetObjectA (handle, sizeof(BITMAP), &bmp); GetObjectA (handle, sizeof(BITMAP), &bmp);
/* To match windows behavior, if cx is set to zero and
the flag DI_DEFAULTSIZE is specified, cx becomes the
system metric value for icons. If the flag is not specified
the function sets the size to the height of the bitmap */
if (cx == 0)
{
if (uFlags & DI_DEFAULTSIZE)
cx = GetSystemMetrics (SM_CXICON);
else
cx = bmp.bmHeight;
}
nImageCount = bmp.bmWidth / cx; nImageCount = bmp.bmWidth / cx;
himl = ImageList_Create (cx, bmp.bmHeight, ILC_MASK | ILC_COLOR, himl = ImageList_Create (cx, bmp.bmHeight, ILC_MASK | ILC_COLOR,