Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionCBitmap tmpbmp; tmpbmp.LoadBitmap(smile); HBITMAP hBitmap = (HBITMAP)tmpbmp; BITMAPINFO bitMapInfo; GetDIBits(GetDC(), hBitmap, 0, 20, NULL, &bitMapInfo, DIB_RGB_COLORS); int rred = bitMapInfo.bmiColors[0].rgbRed; int ggreen = bitMapInfo.bmiColors[0].rgbGreen; int bblue = bitMapInfo.bmiColors[0].rgbBlue; for (int i = 0; i < 324/*bitMapInfo.bmiHeader.biHeight * bitMapInfo.bmiHeader.biWidth*/; i++) { if (bitMapInfo.bmiColors[i].rgbRed == rred && bitMapInfo.bmiColors[i].rgbGreen == ggreen && bitMapInfo.bmiColors[i].rgbBlue == bblue) { bitMapInfo.bmiColors[i].rgbRed = 0;//GetRValue(WinUtil::bgColor); bitMapInfo.bmiColors[i].rgbGreen = 0;//GetGValue(WinUtil::bgColor); bitMapInfo.bmiColors[i].rgbBlue = 128;//GetBValue(WinUtil::bgColor); } } SetDIBits(GetDC(), hBitmap, 0, 20, NULL, &bitMapInfo, DIB_RGB_COLORS); CImageDataObject::InsertBitmap(ctrlClient.GetOleInterface(), hBitmap);