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