Changeset 6709 for trunk/src/comctl32/imagelist.c
- Timestamp:
- Sep 15, 2001, 11:26:26 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/imagelist.c
r6705 r6709 20 20 * - ImageList_Draw, ImageList_DrawEx and ImageList_GetIcon use 21 21 * ImageList_DrawIndirect. Since ImageList_DrawIndirect is still 22 * partially implemented, the functions mentioned above will be 22 * partially implemented, the functions mentioned above will be 23 23 * limited in functionality too. 24 24 */ … … 69 69 70 70 /************************************************************************* 71 * IMAGELIST_InternalExpandBitmaps [Internal] 71 * IMAGELIST_InternalExpandBitmaps [Internal] 72 72 * 73 73 * Expands the bitmaps of an image list by the given number of images. … … 92 92 if ((himl->cCurImage + nImageCount < himl->cMaxImage) 93 93 && (himl->cy >= cy)) 94 94 return; 95 95 96 96 if (cy == 0) cy = himl->cy; … … 116 116 117 117 if (himl->hbmMask) { 118 hbmNewBitmap = 118 hbmNewBitmap = 119 119 CreateBitmap (nNewWidth, cy, 1, 1, NULL); 120 120 … … 138 138 139 139 /************************************************************************* 140 * IMAGELIST_InternalDraw [Internal] 140 * IMAGELIST_InternalDraw [Internal] 141 141 * 142 142 * Draws the image in the ImageList (without the mask) … … 151 151 * 152 152 * NOTES 153 * This function is used by ImageList_DrawIndirect, when it is 153 * This function is used by ImageList_DrawIndirect, when it is 154 154 * required to draw only the Image (without the mask) to the screen. 155 155 * … … 164 164 hImageDC = CreateCompatibleDC(0); 165 165 hOldBitmap = SelectObject(hImageDC, pimldp->himl->hbmImage); 166 BitBlt(pimldp->hdcDst, 166 BitBlt(pimldp->hdcDst, 167 167 pimldp->x, pimldp->y, cx, cy, 168 hImageDC, 169 pimldp->himl->cx * pimldp->i, 0, 168 hImageDC, 169 pimldp->himl->cx * pimldp->i, 0, 170 170 SRCCOPY); 171 171 … … 176 176 177 177 /************************************************************************* 178 * IMAGELIST_InternalDrawMask [Internal] 178 * IMAGELIST_InternalDrawMask [Internal] 179 179 * 180 180 * Draws the image in the ImageList with the mask … … 189 189 * 190 190 * NOTES 191 * This function is used by ImageList_DrawIndirect, when it is 191 * This function is used by ImageList_DrawIndirect, when it is 192 192 * required to draw the Image with the mask to the screen. 193 193 * … … 205 205 UINT fStyle = pimldp->fStyle & (~ILD_OVERLAYMASK); 206 206 207 /* 208 * We need a dc and bitmap to draw on that is 207 /* 208 * We need a dc and bitmap to draw on that is 209 209 * not on the screen. 210 210 */ … … 221 221 hOffScreenDC = CreateCompatibleDC( pimldp->hdcDst ); 222 222 223 if ( hOffScreenDC ) 223 if ( hOffScreenDC ) 224 224 { 225 225 hOffScreenBmp = CreateCompatibleBitmap( pimldp->hdcDst, cx, cy ); 226 226 227 if ( hOffScreenBmp ) 227 if ( hOffScreenBmp ) 228 228 SelectObject( hOffScreenDC, hOffScreenBmp ); 229 229 else … … 235 235 hOldBitmapImage = SelectObject(hImageDC, himlLocal->hbmImage); 236 236 hOldBitmapMask = SelectObject(hMaskDC, himlLocal->hbmMask); 237 238 /* 239 * Get a copy of the image for the masking operations. 237 238 /* 239 * Get a copy of the image for the masking operations. 240 240 * We will use the copy, and this dc for all the various 241 241 * blitting, and then do one final blit to the screen dc. 242 242 * This should clean up most of the flickering. 243 243 */ 244 BitBlt( hOffScreenDC, 0, 0, cx, cy, pimldp->hdcDst, pimldp->x, 244 BitBlt( hOffScreenDC, 0, 0, cx, cy, pimldp->hdcDst, pimldp->x, 245 245 pimldp->y, SRCCOPY); 246 246 247 /* 247 /* 248 248 * Draw the Background for the appropriate Styles 249 249 */ 250 if( bUseCustomBackground && (fStyle == ILD_NORMAL || fStyle & ILD_IMAGE 250 if( bUseCustomBackground && (fStyle == ILD_NORMAL || fStyle & ILD_IMAGE 251 251 || bBlendFlag) ) 252 252 { 253 253 254 254 hBrush = CreateSolidBrush (himlLocal->clrBk); 255 255 hOldBrush = SelectObject (pimldp->hdcDst, hBrush); 256 256 257 257 PatBlt( hOffScreenDC, pimldp->x, pimldp->y, cx, cy, PATCOPY ); 258 258 … … 260 260 } 261 261 262 /* 262 /* 263 263 * Draw Image Transparently over the current background 264 264 */ 265 if(fStyle == ILD_NORMAL || (fStyle & ILD_TRANSPARENT) || 266 ((fStyle & ILD_IMAGE) && bUseCustomBackground) || bBlendFlag) 267 { /* 265 if(fStyle == ILD_NORMAL || (fStyle & ILD_TRANSPARENT) || 266 ((fStyle & ILD_IMAGE) && bUseCustomBackground) || bBlendFlag) 267 { /* 268 268 * To obtain a transparent look, background color should be set 269 * to white and foreground color to black when blting the 270 * monochrome mask. 269 * to white and foreground color to black when blting the 270 * monochrome mask. 271 271 */ 272 273 oldBkColor = SetBkColor( hOffScreenDC, RGB( 0xff, 0xff, 0xff ) ); 272 273 oldBkColor = SetBkColor( hOffScreenDC, RGB( 0xff, 0xff, 0xff ) ); 274 274 oldFgColor = SetTextColor( hOffScreenDC, RGB( 0, 0, 0 ) ); 275 275 … … 279 279 BitBlt( hOffScreenDC, 0, 0, cx, cy, hImageDC,himlLocal->cx * pimldp->i, 280 280 0, SRCPAINT ); 281 282 } 283 281 282 } 283 284 284 /* 285 285 * Draw the image when no Background is specified … … 287 287 else if((fStyle & ILD_IMAGE) && !bUseCustomBackground) 288 288 { 289 BitBlt( hOffScreenDC, 0, 0, cx, cy, hImageDC, 289 BitBlt( hOffScreenDC, 0, 0, cx, cy, hImageDC, 290 290 himlLocal->cx * pimldp->i, 0, SRCCOPY); 291 291 } 292 /* 292 /* 293 293 * Draw the mask with or without a background 294 294 */ … … 298 298 0, bUseCustomBackground ? SRCCOPY : SRCAND); 299 299 } 300 300 301 301 /* 302 302 * Blit the bitmap to the screen now. … … 305 305 hOffScreenDC, 0, 0, SRCCOPY); 306 306 307 307 308 308 SelectObject(hImageDC, hOldBitmapImage); 309 309 SelectObject(hMaskDC, hOldBitmapMask); 310 310 311 311 cleanup: 312 312 313 313 DeleteDC(hImageDC); 314 314 DeleteDC(hMaskDC); 315 315 316 316 DeleteDC( hOffScreenDC ); 317 317 DeleteObject( hOffScreenBmp ); 318 318 319 319 return; 320 320 } 321 321 322 322 /************************************************************************* 323 * IMAGELIST_InternalDrawBlend [Internal] 324 * 325 * Draws the Blend over the current image 323 * IMAGELIST_InternalDrawBlend [Internal] 324 * 325 * Draws the Blend over the current image 326 326 * 327 327 * PARAMS … … 334 334 * 335 335 * NOTES 336 * This functions is used by ImageList_DrawIndirect, when it is 337 * required to add the blend to the current image. 338 * 336 * This functions is used by ImageList_DrawIndirect, when it is 337 * required to add the blend to the current image. 338 * 339 339 */ 340 340 static VOID … … 375 375 376 376 BitBlt(hBlendMaskDC, 377 0,0, cx, cy, 377 0,0, cx, cy, 378 378 hMaskDC, 379 379 himlLocal->cx * pimldp->i,0, … … 381 381 382 382 BitBlt(hBlendMaskDC, 383 0,0, cx, cy, 383 0,0, cx, cy, 384 384 hBlendMaskDC, 385 0,0, 385 0,0, 386 386 NOTSRCCOPY); 387 387 … … 397 397 hOldBrush = (HBRUSH) SelectObject (pimldp->hdcDst, hBlendColorBrush); 398 398 399 BitBlt (pimldp->hdcDst, 400 pimldp->x, pimldp->y, cx, cy, 401 hBlendMaskDC, 402 0, 0, 399 BitBlt (pimldp->hdcDst, 400 pimldp->x, pimldp->y, cx, cy, 401 hBlendMaskDC, 402 0, 0, 403 403 0xB8074A); /* PSDPxax */ 404 404 … … 413 413 414 414 /************************************************************************* 415 * IMAGELIST_InternalDrawOverlay [Internal] 416 * 417 * Draws the overlay image 415 * IMAGELIST_InternalDrawOverlay [Internal] 416 * 417 * Draws the overlay image 418 418 * 419 419 * PARAMS … … 426 426 * 427 427 * NOTES 428 * This functions is used by ImageList_DrawIndirect, when it is 428 * This functions is used by ImageList_DrawIndirect, when it is 429 429 * required to draw the overlay 430 430 * 431 * 432 */ 433 static VOID 431 * 432 */ 433 static VOID 434 434 IMAGELIST_InternalDrawOverlay(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) 435 435 { … … 447 447 if (pimldp->himl->hbmMask) 448 448 { 449 hOldBitmap = (HBITMAP) SelectObject (hImageDC, 449 hOldBitmap = (HBITMAP) SelectObject (hImageDC, 450 450 pimldp->himl->hbmMask); 451 451 452 BitBlt (pimldp->hdcDst, 452 BitBlt (pimldp->hdcDst, 453 453 pimldp->x, pimldp->y, cx, cy, 454 454 hImageDC, pimldp->himl->cx * nOvlIdx, 0, … … 457 457 SelectObject(hImageDC, hOldBitmap); 458 458 } 459 hOldBitmap = (HBITMAP) SelectObject (hImageDC, 459 hOldBitmap = (HBITMAP) SelectObject (hImageDC, 460 460 pimldp->himl->hbmImage); 461 461 462 BitBlt (pimldp->hdcDst, 463 pimldp->x, pimldp->y, cx, cy, 462 BitBlt (pimldp->hdcDst, 463 pimldp->x, pimldp->y, cx, cy, 464 464 hImageDC, 465 465 pimldp->himl->cx * nOvlIdx, 0, … … 492 492 493 493 INT WINAPI 494 ImageList_Add (HIMAGELIST himl, 494 ImageList_Add (HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask) 495 495 { 496 496 HDC hdcImage, hdcBitmap; … … 531 531 hOldBitmapTemp = (HBITMAP) SelectObject(hdcTemp, hbmMask); 532 532 533 BitBlt (hdcMask, 533 BitBlt (hdcMask, 534 534 nStartX, 0, bmp.bmWidth, bmp.bmHeight, 535 hdcTemp, 536 0, 0, 535 hdcTemp, 536 0, 0, 537 537 SRCCOPY); 538 538 … … 542 542 /* Remove the background from the image 543 543 */ 544 BitBlt (hdcImage, 544 BitBlt (hdcImage, 545 545 nStartX, 0, bmp.bmWidth, bmp.bmHeight, 546 hdcMask, 547 nStartX, 0, 546 hdcMask, 547 nStartX, 0, 548 548 0x220326); /* NOTSRCAND */ 549 549 … … 586 586 587 587 /************************************************************************* 588 * ImageList_AddMasked [COMCTL32.42] 588 * ImageList_AddMasked [COMCTL32.42] 589 589 * 590 590 * Adds an image or images to an image list and creates a mask from the … … 651 651 GetPixel (hdcBitmap, 0, 0); 652 652 SetBkColor (hdcBitmap, bkColor); 653 BitBlt (hdcMask, 653 BitBlt (hdcMask, 654 654 nMaskXOffset, 0, bmp.bmWidth, bmp.bmHeight, 655 hdcBitmap, 0, 0, 655 hdcBitmap, 0, 0, 656 656 SRCCOPY); 657 657 … … 668 668 This is here in case some apps rely on this bug 669 669 */ 670 BitBlt(hdcBitmap, 670 BitBlt(hdcBitmap, 671 671 0, 0, bmp.bmWidth, bmp.bmHeight, 672 hdcMask, 673 nMaskXOffset, 0, 672 hdcMask, 673 nMaskXOffset, 0, 674 674 0x220326); /* NOTSRCAND */ 675 675 /* Copy result to the imagelist 676 676 */ 677 BitBlt (hdcImage, 677 BitBlt (hdcImage, 678 678 nIndex * himl->cx, 0, bmp.bmWidth, bmp.bmHeight, 679 hdcBitmap, 680 0, 0, 679 hdcBitmap, 680 0, 0, 681 681 SRCCOPY); 682 682 /* Clean up … … 698 698 699 699 /************************************************************************* 700 * ImageList_BeginDrag [COMCTL32.43] 700 * ImageList_BeginDrag [COMCTL32.43] 701 701 * 702 702 * Creates a temporary image list that contains one image. It will be used … … 716 716 BOOL WINAPI 717 717 ImageList_BeginDrag (HIMAGELIST himlTrack, INT iTrack, 718 718 INT dxHotspot, INT dyHotspot) 719 719 { 720 720 HDC hdcSrc, hdcDst; … … 723 723 724 724 if (himlTrack == NULL) 725 725 return FALSE; 726 726 727 727 if (himlInternalDrag) … … 729 729 730 730 himlInternalDrag = 731 732 731 ImageList_Create (himlTrack->cx, himlTrack->cy, 732 himlTrack->flags, 1, 1); 733 733 if (himlInternalDrag == NULL) { 734 734 ERR("Error creating drag image list!\n"); … … 764 764 765 765 /************************************************************************* 766 * ImageList_Copy [COMCTL32.44] 767 * 768 * Copies an image of the source image list to an image of the 766 * ImageList_Copy [COMCTL32.44] 767 * 768 * Copies an image of the source image list to an image of the 769 769 * destination image list. Images can be copied or swapped. 770 770 * … … 787 787 788 788 BOOL WINAPI 789 ImageList_Copy (HIMAGELIST himlDst, INT iDst, 790 791 { 792 HDC hdcSrc, hdcDst; 789 ImageList_Copy (HIMAGELIST himlDst, INT iDst, HIMAGELIST himlSrc, 790 INT iSrc, INT uFlags) 791 { 792 HDC hdcSrc, hdcDst; 793 793 794 794 TRACE("iDst=%d iSrc=%d\n", iDst, iSrc); 795 795 796 796 if ((himlSrc == NULL) || (himlDst == NULL)) 797 797 return FALSE; 798 798 if ((iDst < 0) || (iDst >= himlDst->cCurImage)) 799 799 return FALSE; 800 800 if ((iSrc < 0) || (iSrc >= himlSrc->cCurImage)) 801 801 return FALSE; 802 802 803 803 hdcSrc = CreateCompatibleDC (0); … … 815 815 himlSrc->uBitsPixel, NULL); 816 816 hbmTempMask = CreateBitmap (himlSrc->cx, himlSrc->cy, 1, 817 817 1, NULL); 818 818 819 819 /* copy (and stretch) destination to temporary bitmaps.(save) */ … … 908 908 HIMAGELIST WINAPI 909 909 ImageList_Create (INT cx, INT cy, UINT flags, 910 910 INT cInitial, INT cGrow) 911 911 { 912 912 HIMAGELIST himl; … … 914 914 INT nCount; 915 915 HBITMAP hbmTemp; 916 static WORD aBitBlend25[] = 916 static WORD aBitBlend25[] = 917 917 {0xAA, 0x00, 0x55, 0x00, 0xAA, 0x00, 0x55, 0x00}; 918 918 … … 948 948 if (himl->cMaxImage > 0) { 949 949 himl->hbmImage = 950 950 CreateBitmap (himl->cx * himl->cMaxImage, himl->cy, 951 951 1, himl->uBitsPixel, NULL); 952 953 954 955 952 if (himl->hbmImage == 0) { 953 ERR("Error creating image bitmap!\n"); 954 return NULL; 955 } 956 956 } 957 957 else 958 958 himl->hbmImage = 0; 959 959 960 960 if ( (himl->cMaxImage > 0) && (himl->flags & ILC_MASK)) { 961 961 himl->hbmMask = CreateBitmap (himl->cx * himl->cMaxImage, himl->cy, 962 962 1, 1, NULL); 963 963 if (himl->hbmMask == 0) { 964 964 ERR("Error creating mask bitmap!\n"); … … 986 986 987 987 /************************************************************************* 988 * ImageList_Destroy [COMCTL32.46] 988 * ImageList_Destroy [COMCTL32.46] 989 989 * 990 990 * Destroys an image list. … … 1000 1000 BOOL WINAPI 1001 1001 ImageList_Destroy (HIMAGELIST himl) 1002 { 1002 { 1003 1003 if (!himl) 1004 1004 return FALSE; 1005 1005 1006 1006 /* delete image bitmaps */ … … 1015 1015 if (himl->hbrBlend50) 1016 1016 DeleteObject (himl->hbrBlend50); 1017 1017 1018 1018 COMCTL32_Free (himl); 1019 1019 … … 1023 1023 1024 1024 /************************************************************************* 1025 * ImageList_DragEnter [COMCTL32.47] 1025 * ImageList_DragEnter [COMCTL32.47] 1026 1026 * 1027 1027 * Locks window update and displays the drag image at the given position. … … 1045 1045 { 1046 1046 if (himlInternalDrag == NULL) 1047 1047 return FALSE; 1048 1048 1049 1049 if (hwndLock) 1050 1050 hwndInternalDrag = hwndLock; 1051 1051 else 1052 1052 hwndInternalDrag = GetDesktopWindow (); 1053 1053 1054 1054 xInternalPos = x; … … 1057 1057 hdcBackBuffer = CreateCompatibleDC (0); 1058 1058 hbmBackBuffer = CreateCompatibleBitmap (hdcBackBuffer, 1059 1059 himlInternalDrag->cx, himlInternalDrag->cy); 1060 1060 1061 1061 ImageList_DragShowNolock (TRUE); … … 1066 1066 1067 1067 /************************************************************************* 1068 * ImageList_DragLeave [COMCTL32.48] 1068 * ImageList_DragLeave [COMCTL32.48] 1069 1069 * 1070 1070 * Unlocks window update and hides the drag image. … … 1082 1082 { 1083 1083 if (hwndLock) 1084 1084 hwndInternalDrag = hwndLock; 1085 1085 else 1086 1086 hwndInternalDrag = GetDesktopWindow (); 1087 1087 1088 1088 ImageList_DragShowNolock (FALSE); … … 1096 1096 1097 1097 /************************************************************************* 1098 * ImageList_DragMove [COMCTL32.49] 1098 * ImageList_DragMove [COMCTL32.49] 1099 1099 * 1100 1100 * Moves the drag image. … … 1128 1128 1129 1129 /************************************************************************* 1130 * ImageList_DragShowNolock [COMCTL32.50] 1130 * ImageList_DragShowNolock [COMCTL32.50] 1131 1131 * 1132 1132 * Shows or hides the drag image. … … 1152 1152 1153 1153 hdcDrag = GetDCEx (hwndInternalDrag, 0, 1154 1154 DCX_WINDOW | DCX_CACHE | DCX_LOCKWINDOWUPDATE); 1155 1155 1156 1156 if (bShow) { 1157 1158 1159 1160 1161 1157 /* show drag image */ 1158 1159 /* save background */ 1160 1161 /* draw drag image */ 1162 1162 1163 1163 } 1164 1164 else { 1165 1166 1167 1165 /* hide drag image */ 1166 1167 /* restore background */ 1168 1168 1169 1169 } … … 1199 1199 BOOL WINAPI 1200 1200 ImageList_Draw (HIMAGELIST himl, INT i, HDC hdc, 1201 1201 INT x, INT y, UINT fStyle) 1202 1202 { 1203 1203 IMAGELISTDRAWPARAMS imldp; … … 1252 1252 BOOL WINAPI 1253 1253 ImageList_DrawEx (HIMAGELIST himl, INT i, HDC hdc, INT x, INT y, 1254 1255 1254 INT dx, INT dy, COLORREF rgbBk, COLORREF rgbFg, 1255 UINT fStyle) 1256 1256 { 1257 1257 IMAGELISTDRAWPARAMS imldp; … … 1277 1277 1278 1278 /************************************************************************* 1279 * ImageList_DrawIndirect [COMCTL32.53] 1279 * ImageList_DrawIndirect [COMCTL32.53] 1280 1280 * 1281 1281 * Draws an image using ... … … 1292 1292 ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp) 1293 1293 { 1294 INT cx, cy; 1295 /* 1294 INT cx, cy; 1295 /* 1296 1296 Do some Error Checking 1297 1297 */ … … 1303 1303 return FALSE; 1304 1304 if ((pimldp->i < 0) || (pimldp->i >= pimldp->himl->cCurImage)) { 1305 1305 ERR("%d not within range (max %d)\n",pimldp->i,pimldp->himl->cCurImage-1); 1306 1306 return FALSE; 1307 1307 } … … 1322 1322 IMAGELIST_InternalDraw(pimldp, cx, cy); 1323 1323 } 1324 /* 1324 /* 1325 1325 Apply the blend if needed to the Image 1326 1326 */ … … 1387 1387 DeleteDC (hdcSrc); 1388 1388 1389 1390 1389 himlDst->cCurImage = himlSrc->cCurImage; 1390 himlDst->cMaxImage = himlSrc->cMaxImage; 1391 1391 } 1392 1392 return himlDst; … … 1447 1447 { 1448 1448 if (himl == NULL) 1449 1449 return CLR_NONE; 1450 1450 1451 1451 return himl->clrBk; … … 1483 1483 1484 1484 /************************************************************************* 1485 * ImageList_GetIcon [COMCTL32.59] 1485 * ImageList_GetIcon [COMCTL32.59] 1486 1486 * 1487 1487 * Creates an icon from a masked image of an image list. … … 1506 1506 1507 1507 if ((himl == NULL) || (i < 0) || (i >= himl->cCurImage)) { 1508 1509 1508 FIXME("(%p,%d,%x), params out of range!\n",himl,i,fStyle); 1509 return 0; 1510 1510 } 1511 1511 … … 1519 1519 hOldDstBitmap = (HBITMAP)SelectObject (hdcDst, ii.hbmMask); 1520 1520 if (himl->hbmMask) { 1521 1522 1523 1521 SelectObject (hdcSrc, himl->hbmMask); 1522 BitBlt (hdcDst, 0, 0, himl->cx, himl->cy, 1523 hdcSrc, i * himl->cx, 0, SRCCOPY); 1524 1524 } 1525 1525 else 1526 1526 PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, BLACKNESS); 1527 1527 1528 1528 /* draw image*/ … … 1531 1531 SelectObject (hdcDst, ii.hbmColor); 1532 1532 BitBlt (hdcDst, 0, 0, himl->cx, himl->cy, 1533 1533 hdcSrc, i * himl->cx, 0, SRCCOPY); 1534 1534 1535 1535 /* 1536 1536 * CreateIconIndirect requires us to deselect the bitmaps from 1537 * the DCs before calling 1537 * the DCs before calling 1538 1538 */ 1539 1539 SelectObject(hdcSrc, hOldSrcBitmap); 1540 1540 SelectObject(hdcDst, hOldDstBitmap); 1541 1541 1542 hIcon = CreateIconIndirect (&ii); 1542 hIcon = CreateIconIndirect (&ii); 1543 1543 1544 1544 DeleteDC (hdcSrc); … … 1573 1573 { 1574 1574 if (himl == NULL) 1575 1575 return FALSE; 1576 1576 if ((himl->cx <= 0) || (himl->cy <= 0)) 1577 1577 return FALSE; 1578 1578 1579 1579 if (cx) 1580 1580 *cx = himl->cx; 1581 1581 if (cy) 1582 1582 *cy = himl->cy; 1583 1583 1584 1584 return TRUE; … … 1603 1603 { 1604 1604 if (himl == NULL) 1605 1605 return 0; 1606 1606 1607 1607 return himl->cCurImage; … … 1628 1628 { 1629 1629 if ((himl == NULL) || (pImageInfo == NULL)) 1630 1630 return FALSE; 1631 1631 if ((i < 0) || (i >= himl->cCurImage)) 1632 1632 return FALSE; 1633 1633 1634 1634 pImageInfo->hbmImage = himl->hbmImage; 1635 1635 pImageInfo->hbmMask = himl->hbmMask; 1636 1636 1637 1637 pImageInfo->rcImage.top = 0; 1638 1638 pImageInfo->rcImage.bottom = himl->cy; 1639 1639 pImageInfo->rcImage.left = i * himl->cx; 1640 1640 pImageInfo->rcImage.right = (i+1) * himl->cx; 1641 1641 1642 1642 return TRUE; 1643 1643 } … … 1645 1645 1646 1646 /************************************************************************* 1647 * ImageList_GetImageRect [COMCTL32.63] 1647 * ImageList_GetImageRect [COMCTL32.63] 1648 1648 * 1649 1649 * Retrieves the rectangle of the specified image in an image list. … … 1666 1666 { 1667 1667 if ((himl == NULL) || (lpRect == NULL)) 1668 1668 return FALSE; 1669 1669 if ((i < 0) || (i >= himl->cCurImage)) 1670 1670 return FALSE; 1671 1671 1672 1672 lpRect->left = i * himl->cx; … … 1704 1704 HIMAGELIST WINAPI 1705 1705 ImageList_LoadImageA (HINSTANCE hi, LPCSTR lpbmp, INT cx, INT cGrow, 1706 1706 COLORREF clrMask, UINT uType, UINT uFlags) 1707 1707 { 1708 1708 HIMAGELIST himl = NULL; … … 1744 1744 GetIconInfo (handle, &ii); 1745 1745 GetObjectA (ii.hbmColor, sizeof(BITMAP), (LPVOID)&bmp); 1746 himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight, 1746 himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight, 1747 1747 ILC_MASK | ILC_COLOR, 1, cGrow); 1748 1748 ImageList_Add (himl, ii.hbmColor, ii.hbmMask); … … 1752 1752 1753 1753 DeleteObject (handle); 1754 1754 1755 1755 return himl; 1756 1756 } … … 1781 1781 HIMAGELIST WINAPI 1782 1782 ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, 1783 COLORREF clrMask, UINT uType,UINT uFlags)1783 COLORREF clrMask, UINT uType, UINT uFlags) 1784 1784 { 1785 1785 HIMAGELIST himl = NULL; … … 1808 1808 GetIconInfo (handle, &ii); 1809 1809 GetObjectA (ii.hbmMask, sizeof(BITMAP), (LPVOID)&bmp); 1810 himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight, 1810 himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight, 1811 1811 ILC_MASK | ILC_COLOR, 1, cGrow); 1812 1812 ImageList_Add (himl, ii.hbmColor, ii.hbmMask); … … 1816 1816 1817 1817 DeleteObject (handle); 1818 1818 1819 1819 return himl; 1820 1820 } … … 1822 1822 1823 1823 /************************************************************************* 1824 * ImageList_Merge [COMCTL32.67] 1824 * ImageList_Merge [COMCTL32.67] 1825 1825 * 1826 1826 * Creates a new image list that contains a merged image from the specified … … 1842 1842 HIMAGELIST WINAPI 1843 1843 ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2, 1844 1844 INT dx, INT dy) 1845 1845 { 1846 1846 HIMAGELIST himlDst = NULL; … … 1851 1851 1852 1852 if ((himl1 == NULL) || (himl2 == NULL)) 1853 1853 return NULL; 1854 1854 1855 1855 /* check indices */ … … 1903 1903 nX1 = i1 * himl1->cx; 1904 1904 nX2 = i2 * himl2->cx; 1905 1905 1906 1906 /* copy image */ 1907 1907 SelectObject (hdcSrcImage, himl1->hbmImage); 1908 1908 SelectObject (hdcDstImage, himlDst->hbmImage); 1909 BitBlt (hdcDstImage, 0, 0, cxDst, cyDst, 1909 BitBlt (hdcDstImage, 0, 0, cxDst, cyDst, 1910 1910 hdcSrcImage, 0, 0, BLACKNESS); 1911 BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy, 1911 BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy, 1912 1912 hdcSrcImage, nX1, 0, SRCCOPY); 1913 1913 1914 1914 SelectObject (hdcSrcImage, himl2->hbmMask); 1915 BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, 1915 BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, 1916 1916 hdcSrcImage, nX2, 0, SRCAND); 1917 1917 1918 1918 SelectObject (hdcSrcImage, himl2->hbmImage); 1919 BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, 1919 BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, 1920 1920 hdcSrcImage, nX2, 0, SRCPAINT); 1921 1921 … … 1923 1923 SelectObject (hdcSrcImage, himl1->hbmMask); 1924 1924 SelectObject (hdcDstImage, himlDst->hbmMask); 1925 BitBlt (hdcDstImage, 0, 0, cxDst, cyDst, 1925 BitBlt (hdcDstImage, 0, 0, cxDst, cyDst, 1926 1926 hdcSrcImage, 0, 0, WHITENESS); 1927 BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy, 1927 BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy, 1928 1928 hdcSrcImage, nX1, 0, SRCCOPY); 1929 1929 1930 1930 SelectObject (hdcSrcImage, himl2->hbmMask); 1931 BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, 1931 BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, 1932 1932 hdcSrcImage, nX2, 0, SRCAND); 1933 1933 … … 1935 1935 DeleteDC (hdcDstImage); 1936 1936 } 1937 1937 1938 1938 return himlDst; 1939 1939 } … … 1945 1945 int bitspixel = GetDeviceCaps(hdc,BITSPIXEL)*GetDeviceCaps(hdc,PLANES); 1946 1946 if (bitspixel>8) 1947 1947 return TRUE; 1948 1948 if (bitspixel<=4) 1949 1949 return FALSE; 1950 1950 return GetDeviceCaps(hdc,CAPS1) & C1_DIBENGINE; 1951 1951 } … … 1954 1954 /* helper for ImageList_Read, see comments below */ 1955 1955 static HBITMAP _read_bitmap(LPSTREAM pstm,int ilcFlag,int cx,int cy) { 1956 HDC 1957 BITMAPFILEHEADER 1958 BITMAPINFOHEADER 1959 int 1960 LPBITMAPINFOHEADER 1961 int 1962 HBITMAP 1963 LPBYTE 1964 int 1965 1966 if (!SUCCEEDED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL)) 1967 (bmfh.bfType != (('M'<<8)|'B'))||1968 !SUCCEEDED(IStream_Read ( pstm, &bmih, sizeof(bmih), NULL))||1969 1956 HDC xdc = 0; 1957 BITMAPFILEHEADER bmfh; 1958 BITMAPINFOHEADER bmih; 1959 int bitsperpixel,palspace,longsperline,width,height; 1960 LPBITMAPINFOHEADER bmihc = NULL; 1961 int result = 0; 1962 HBITMAP hbitmap = 0; 1963 LPBYTE bits = NULL,nbits = NULL; 1964 int nbytesperline,bytesperline; 1965 1966 if (!SUCCEEDED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL)) || 1967 (bmfh.bfType != (('M'<<8)|'B')) || 1968 !SUCCEEDED(IStream_Read ( pstm, &bmih, sizeof(bmih), NULL)) || 1969 (bmih.biSize != sizeof(bmih)) 1970 1970 ) 1971 1971 return 0; 1972 1972 1973 1973 bitsperpixel = bmih.biPlanes * bmih.biBitCount; 1974 1974 if (bitsperpixel<=8) 1975 1975 palspace = (1<<bitsperpixel)*sizeof(RGBQUAD); 1976 1976 else 1977 1977 palspace = 0; 1978 1978 width = bmih.biWidth; 1979 1979 height = bmih.biHeight; 1980 1980 bmihc = (LPBITMAPINFOHEADER)LocalAlloc(LMEM_ZEROINIT,sizeof(bmih)+palspace); 1981 1981 memcpy(bmihc,&bmih,sizeof(bmih)); 1982 longsperline 1983 bmihc->biSizeImage 1982 longsperline = ((width*bitsperpixel+31)&~0x1f)>>5; 1983 bmihc->biSizeImage = (longsperline*height)<<2; 1984 1984 1985 1985 /* read the palette right after the end of the bitmapinfoheader */ 1986 1986 if (palspace) 1987 1988 1987 if (!SUCCEEDED(IStream_Read ( pstm, bmihc+1, palspace, NULL))) 1988 goto ret1; 1989 1989 1990 1990 xdc = GetDC(0); 1991 1991 #if 0 /* Magic for NxM -> 1x(N*M) not implemented for DIB Sections */ 1992 1992 if ((bitsperpixel>1) && 1993 1993 ((ilcFlag!=ILC_COLORDDB) && (!ilcFlag || may_use_dibsection(xdc))) 1994 1994 ) { 1995 1996 1997 1998 1999 2000 1995 hbitmap = CreateDIBSection(xdc,(BITMAPINFO*)bmihc,0,(LPVOID*)&bits,0,0); 1996 if (!hbitmap) 1997 goto ret1; 1998 if (!SUCCEEDED(IStream_Read( pstm, bits, bmihc->biSizeImage, NULL))) 1999 goto ret1; 2000 result = 1; 2001 2001 } else 2002 2002 #endif 2003 2003 { 2004 2005 2006 nwidth= width*(height/cy);2007 nheight= cy;2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 bytesperline= longsperline*4;2023 nbytesperline= (height/cy)*bytesperline;2024 2025 2026 2027 2028 2029 2030 2031 bmihc->biWidth= nwidth;2032 bmihc->biHeight= nheight;2033 2034 2035 2036 2037 2004 int i,nwidth,nheight; 2005 2006 nwidth = width*(height/cy); 2007 nheight = cy; 2008 2009 if (bitsperpixel==1) 2010 hbitmap = CreateBitmap(nwidth,nheight,1,1,NULL); 2011 else 2012 hbitmap = CreateCompatibleBitmap(xdc,nwidth,nheight); 2013 2014 /* Might be a bit excessive memory use here */ 2015 bits = (LPBYTE)LocalAlloc(LMEM_ZEROINIT,bmihc->biSizeImage); 2016 nbits = (LPBYTE)LocalAlloc(LMEM_ZEROINIT,bmihc->biSizeImage); 2017 if (!SUCCEEDED(IStream_Read ( pstm, bits, bmihc->biSizeImage, NULL))) 2018 goto ret1; 2019 2020 /* Copy the NxM bitmap into a 1x(N*M) bitmap we need, linewise */ 2021 /* Do not forget that windows bitmaps are bottom->top */ 2022 bytesperline = longsperline*4; 2023 nbytesperline = (height/cy)*bytesperline; 2024 for (i=0;i<height;i++) { 2025 memcpy( 2026 nbits+((height-1-i)%cy)*nbytesperline+(i/cy)*bytesperline, 2027 bits+bytesperline*(height-1-i), 2028 bytesperline 2029 ); 2030 } 2031 bmihc->biWidth = nwidth; 2032 bmihc->biHeight = nheight; 2033 if (!SetDIBits(xdc,hbitmap,0,nheight,nbits,(BITMAPINFO*)bmihc,0)) 2034 goto ret1; 2035 LocalFree((HLOCAL)nbits); 2036 LocalFree((HLOCAL)bits); 2037 result = 1; 2038 2038 } 2039 2039 ret1: 2040 if (xdc) 2041 if (bmihc) 2040 if (xdc) ReleaseDC(0,xdc); 2041 if (bmihc) LocalFree((HLOCAL)bmihc); 2042 2042 if (!result) { 2043 2044 2045 2046 2043 if (hbitmap) { 2044 DeleteObject(hbitmap); 2045 hbitmap = 0; 2046 } 2047 2047 } 2048 2048 return hbitmap; … … 2062 2062 * 2063 2063 * The format is like this: 2064 * ILHEADilheadstruct;2064 * ILHEAD ilheadstruct; 2065 2065 * 2066 2066 * for the color image part: 2067 * BITMAPFILEHEADER bmfh;2068 * BITMAPINFOHEADERbmih;2067 * BITMAPFILEHEADER bmfh; 2068 * BITMAPINFOHEADER bmih; 2069 2069 * only if it has a palette: 2070 * RGBQUAD rgbs[nr_of_paletted_colors];2071 * 2072 * BYTEcolorbits[imagesize];2070 * RGBQUAD rgbs[nr_of_paletted_colors]; 2071 * 2072 * BYTE colorbits[imagesize]; 2073 2073 * 2074 2074 * the following only if the ILC_MASK bit is set in ILHEAD.ilFlags: 2075 * BITMAPFILEHEADERbmfh_mask;2076 * BITMAPINFOHEADERbmih_mask;2075 * BITMAPFILEHEADER bmfh_mask; 2076 * BITMAPINFOHEADER bmih_mask; 2077 2077 * only if it has a palette (it usually does not): 2078 * RGBQUAD rgbs[nr_of_paletted_colors];2079 * 2080 * BYTEmaskbits[imagesize];2078 * RGBQUAD rgbs[nr_of_paletted_colors]; 2079 * 2080 * BYTE maskbits[imagesize]; 2081 2081 * 2082 2082 * CAVEAT: Those images are within a NxM bitmap, not the 1xN we expect. … … 2085 2085 HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm) 2086 2086 { 2087 ILHEAD 2088 HIMAGELIST 2089 HBITMAP 2090 int 2087 ILHEAD ilHead; 2088 HIMAGELIST himl; 2089 HBITMAP hbmColor=0,hbmMask=0; 2090 int i; 2091 2091 2092 2092 if (!SUCCEEDED(IStream_Read (pstm, &ilHead, sizeof(ILHEAD), NULL))) 2093 2093 return NULL; 2094 2094 if (ilHead.usMagic != (('L' << 8) | 'I')) 2095 2095 return NULL; 2096 2096 if (ilHead.usVersion != 0x101) /* probably version? */ 2097 2097 return NULL; 2098 2098 2099 2099 #if 0 2100 FIXME(" 2101 FIXME(" 2102 FIXME(" 2103 FIXME(" 2104 FIXME(" 2105 FIXME(" 2106 FIXME(" 2107 FIXME(" 2108 FIXME(" 2109 FIXME(" 2100 FIXME(" ilHead.cCurImage = %d\n",ilHead.cCurImage); 2101 FIXME(" ilHead.cMaxImage = %d\n",ilHead.cMaxImage); 2102 FIXME(" ilHead.cGrow = %d\n",ilHead.cGrow); 2103 FIXME(" ilHead.cx = %d\n",ilHead.cx); 2104 FIXME(" ilHead.cy = %d\n",ilHead.cy); 2105 FIXME(" ilHead.flags = %x\n",ilHead.flags); 2106 FIXME(" ilHead.ovls[0] = %d\n",ilHead.ovls[0]); 2107 FIXME(" ilHead.ovls[1] = %d\n",ilHead.ovls[1]); 2108 FIXME(" ilHead.ovls[2] = %d\n",ilHead.ovls[2]); 2109 FIXME(" ilHead.ovls[3] = %d\n",ilHead.ovls[3]); 2110 2110 #endif 2111 2111 2112 2112 hbmColor = _read_bitmap(pstm,ilHead.flags & ~ILC_MASK,ilHead.cx,ilHead.cy); 2113 2113 if (!hbmColor) 2114 2114 return NULL; 2115 2115 if (ilHead.flags & ILC_MASK) { 2116 2117 2118 2119 2120 2116 hbmMask = _read_bitmap(pstm,0,ilHead.cx,ilHead.cy); 2117 if (!hbmMask) { 2118 DeleteObject(hbmColor); 2119 return NULL; 2120 } 2121 2121 } 2122 2122 2123 2123 himl = ImageList_Create ( 2124 2125 2126 2127 1,/* initial */2128 2124 ilHead.cx, 2125 ilHead.cy, 2126 ilHead.flags, 2127 1, /* initial */ 2128 ilHead.cGrow 2129 2129 ); 2130 2130 if (!himl) { 2131 2132 2133 2131 DeleteObject(hbmColor); 2132 DeleteObject(hbmMask); 2133 return NULL; 2134 2134 } 2135 2135 himl->hbmImage = hbmColor; … … 2140 2140 ImageList_SetBkColor(himl,ilHead.bkcolor); 2141 2141 for (i=0;i<4;i++) 2142 2142 ImageList_SetOverlayImage(himl,ilHead.ovls[i],i+1); 2143 2143 return himl; 2144 2144 } … … 2168 2168 return FALSE; 2169 2169 } 2170 2170 2171 2171 if ((i < -1) || (i >= himl->cCurImage)) { 2172 2172 ERR("index out of range! %d\n", i); … … 2211 2211 TRACE(" - Max. number of images: %d / %d (Old/New)\n", 2212 2212 himl->cMaxImage, himl->cCurImage + himl->cGrow - 1); 2213 2213 2214 2214 hbmNewImage = 2215 2215 CreateBitmap (cxNew, himl->cy, 1, himl->uBitsPixel, NULL); … … 2226 2226 if (i > 0) { 2227 2227 TRACE("Pre image copy: Copy %d images\n", i); 2228 2228 2229 2229 SelectObject (hdcSrc, himl->hbmImage); 2230 2230 SelectObject (hdcDst, hbmNewImage); … … 2277 2277 2278 2278 /************************************************************************* 2279 * ImageList_Replace [COMCTL32.70] 2279 * ImageList_Replace [COMCTL32.70] 2280 2280 * 2281 2281 * Replaces an image in an image list with a new image. … … 2294 2294 BOOL WINAPI 2295 2295 ImageList_Replace (HIMAGELIST himl, INT i, HBITMAP hbmImage, 2296 2296 HBITMAP hbmMask) 2297 2297 { 2298 2298 HDC hdcImageList, hdcImage; … … 2303 2303 return FALSE; 2304 2304 } 2305 2305 2306 2306 if ((i >= himl->cMaxImage) || (i < 0)) { 2307 2307 ERR("Invalid image index!\n"); … … 2333 2333 */ 2334 2334 SelectObject (hdcImageList, himl->hbmImage); 2335 StretchBlt (hdcImageList, 2335 StretchBlt (hdcImageList, 2336 2336 i*himl->cx, 0, himl->cx, himl->cy, 2337 hdcImage, 2338 0, 0, bmp.bmWidth, bmp.bmHeight, 2337 hdcImage, 2338 0, 0, bmp.bmWidth, bmp.bmHeight, 2339 2339 0x220326); /* NOTSRCAND */ 2340 2340 } … … 2375 2375 2376 2376 if (himl == NULL) 2377 2377 return -1; 2378 2378 if ((i >= himl->cMaxImage) || (i < -1)) 2379 2379 return -1; 2380 2380 2381 2381 hBestFitIcon = CopyImage( 2382 hIcon, IMAGE_ICON, 2383 himl->cx, himl->cy, 2382 hIcon, IMAGE_ICON, 2383 himl->cx, himl->cy, 2384 2384 LR_COPYFROMRESOURCE); 2385 2385 2386 2386 GetIconInfo (hBestFitIcon, &ii); 2387 2387 if (ii.hbmMask == 0) 2388 2388 ERR("no mask!\n"); 2389 2389 if (ii.hbmColor == 0) 2390 2390 ERR("no color!\n"); 2391 2391 GetObjectA (ii.hbmMask, sizeof(BITMAP), (LPVOID)&bmp); 2392 2392 … … 2404 2404 TRACE("hdcImageList=0x%x!\n", hdcImageList); 2405 2405 if (hdcImageList == 0) 2406 2406 ERR("invalid hdcImageList!\n"); 2407 2407 2408 2408 hdcImage = CreateCompatibleDC (0); 2409 2409 TRACE("hdcImage=0x%x!\n", hdcImage); 2410 2410 if (hdcImage == 0) 2411 2411 ERR("invalid hdcImage!\n"); 2412 2412 2413 2413 hbmOldDst = SelectObject (hdcImageList, himl->hbmImage); … … 2429 2429 2430 2430 if(hBestFitIcon) 2431 2431 DestroyIcon(hBestFitIcon); 2432 2432 if (hdcImageList) 2433 2433 DeleteDC (hdcImageList); 2434 2434 if (hdcImage) 2435 2435 DeleteDC (hdcImage); 2436 2436 if (ii.hbmColor) 2437 2437 DeleteObject (ii.hbmColor); 2438 2438 if (ii.hbmMask) 2439 2439 DeleteObject (ii.hbmMask); 2440 2440 2441 2441 return nIndex; … … 2444 2444 2445 2445 /************************************************************************* 2446 * ImageList_SetBkColor [COMCTL32.76] 2446 * ImageList_SetBkColor [COMCTL32.76] 2447 2447 * 2448 2448 * Sets the background color of an image list. … … 2463 2463 2464 2464 if (himl == NULL) 2465 2465 return CLR_NONE; 2466 2466 2467 2467 clrOldBk = himl->clrBk; … … 2492 2492 BOOL WINAPI 2493 2493 ImageList_SetDragCursorImage (HIMAGELIST himlDrag, INT iDrag, 2494 2494 INT dxHotspot, INT dyHotspot) 2495 2495 { 2496 2496 HIMAGELIST himlTemp; … … 2499 2499 2500 2500 if (himlInternalDrag == NULL) 2501 2501 return FALSE; 2502 2502 2503 2503 TRACE(" dxH=%d dyH=%d nX=%d nY=%d\n", 2504 2504 dxHotspot, dyHotspot, nInternalDragHotspotX, nInternalDragHotspotY); 2505 2505 2506 2506 himlTemp = ImageList_Merge (himlInternalDrag, 0, himlDrag, iDrag, 2507 2507 dxHotspot, dyHotspot); 2508 2508 2509 2509 ImageList_Destroy (himlInternalDrag); … … 2518 2518 2519 2519 /************************************************************************* 2520 * ImageList_SetFilter [COMCTL32.78] 2520 * ImageList_SetFilter [COMCTL32.78] 2521 2521 * 2522 2522 * Sets a filter (or does something completely different)!!??? … … 2540 2540 { 2541 2541 FIXME("(%p 0x%x 0x%lx):empty stub!\n", 2542 2542 himl, i, dwFilter); 2543 2543 2544 2544 return FALSE; … … 2567 2567 2568 2568 if (!himl) 2569 2569 return FALSE; 2570 2570 2571 2571 /* remove all images */ … … 2617 2617 2618 2618 if (!himl) 2619 2619 return FALSE; 2620 2620 if (himl->cCurImage >= iImageCount) 2621 2621 return FALSE; 2622 2622 if (himl->cMaxImage > iImageCount) 2623 2623 return TRUE; 2624 2624 2625 2625 nNewCount = iImageCount + himl->cGrow; … … 2636 2636 SelectObject (hdcBitmap, hbmNewBitmap); 2637 2637 2638 2638 /* copy images */ 2639 2639 BitBlt (hdcBitmap, 0, 0, nCopyCount * himl->cx, himl->cy, 2640 2640 hdcImageList, 0, 0, SRCCOPY); 2641 2641 #if 0 2642 2643 2644 2645 PatBlt (hdcBitmap, nCopyCount * himl->cx, 0, 2646 2642 /* delete 'empty' image space */ 2643 SetBkColor (hdcBitmap, RGB(255, 255, 255)); 2644 SetTextColor (hdcBitmap, RGB(0, 0, 0)); 2645 PatBlt (hdcBitmap, nCopyCount * himl->cx, 0, 2646 (nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS); 2647 2647 #endif 2648 2649 2648 DeleteObject (himl->hbmImage); 2649 himl->hbmImage = hbmNewBitmap; 2650 2650 } 2651 2651 else 2652 2652 ERR("Could not create new image bitmap !\n"); 2653 2653 2654 2654 if (himl->hbmMask) … … 2661 2661 SelectObject (hdcBitmap, hbmNewBitmap); 2662 2662 2663 2663 /* copy images */ 2664 2664 BitBlt (hdcBitmap, 0, 0, nCopyCount * himl->cx, himl->cy, 2665 2665 hdcImageList, 0, 0, SRCCOPY); 2666 2666 #if 0 2667 2668 2669 2670 PatBlt (hdcBitmap, nCopyCount * himl->cx, 0, 2671 2667 /* delete 'empty' image space */ 2668 SetBkColor (hdcBitmap, RGB(255, 255, 255)); 2669 SetTextColor (hdcBitmap, RGB(0, 0, 0)); 2670 PatBlt (hdcBitmap, nCopyCount * himl->cx, 0, 2671 (nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS); 2672 2672 #endif 2673 2673 DeleteObject (himl->hbmMask); … … 2709 2709 { 2710 2710 if (!himl) 2711 2711 return FALSE; 2712 2712 if ((iOverlay < 1) || (iOverlay > MAX_OVERLAYIMAGE)) 2713 2713 return FALSE; 2714 2714 if ((iImage!=-1) && ((iImage < 0) || (iImage > himl->cCurImage))) 2715 2715 return FALSE; 2716 2716 himl->nOvlIdx[iOverlay - 1] = iImage; 2717 2717 return TRUE; … … 2744 2744 { 2745 2745 if (!himl) 2746 return FALSE; 2747 2748 FIXME("empty stub!\n"); 2749 2746 2750 return FALSE; 2747 2748 FIXME("empty stub!\n"); 2749 2750 return FALSE; 2751 } 2752 2751 } 2752
Note:
See TracChangeset
for help on using the changeset viewer.