1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
//recuperer les hbitmap de vos img
HBITMAP TiffBMP = ImgTIFF->MakeBitmap();
HBITMAP TiffJPG = ImgJPEG->MakeBitmap();
HDC hdcImageTIFF = CreateCompatibleDC(NULL);
if (hdcImageTIFF)
SelectObject(hdcImageTIFF, TiffBMP);
HDC hdcImageJPEG = CreateCompatibleDC(NULL);
if (hdcImageJPEG)
SelectObject(hdcImageJPEG, JpgBMP);
// on peint la partie voulu sur l'img voulu
::BitBlt(hdcImageTIFF,0,0,1000,1000,hdcImageJPEG,0,0,SRCCOPY);
// recuperer la bitmap à partir du HDC
HDC cDC = CreateCompatibleDC(0);
HBITMAP hbmp = CreateCompatibleBitmap(hdcImageTIFF, ImgTIFF->GetWidth(),ImgTIFF->GetHeight());
SelectObject( cDC, hbmp );
BitBlt( cDC, 0, 0, ImgTIFF->GetWidth(), ImgTIFF->GetHeight(), hdcImageTIFF, 0, 0, SRCCOPY );
DeleteDC(cDC); |
Partager