Je n'arrive pas à afficher mon image contenue dans mon HDC. En fait je n'ai que du noir dans la PictureBox comme résultat.
Voici mon code, merci d'avance si qq'un peut m'aider :
CStatic* hWndViewer = (CStatic*)GetDlgItem(IDC_PICTURE);
photo = (HBITMAP)LoadImage(NULL,nomImag,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
access = (HBITMAP)accessoire->m_hObject;
SelectObject(hdc_photo,photo);
SelectObject(hdc_access,access;
//je superpose les 2 images(sauf le blanc)
for(i=0;i<largeur;i++)
{
for(j=0;j<hauteur;j++)
{
if(GetPixel(hdc_access,i,j) != RGB(255,255,255))
{
color = GetPixel(hdc_access,i,j);
SetPixel(hdc_photo,i,j,color);
}
}
}
hBmp_FinalDC = CreateCompatibleDC(hdc_photo);
hBmpFinal= CreateCompatibleBitmap(hBmp_FinalDC,largeur,hauteur);
BitBlt(hBmp_FinalDC,0,0,largeur,hauteur,hdc_photo,0,0,SRCCOPY);
//maintenant j'affiche dans le picturebox : (résultat noir)
hWndViewer->SetBitmap(hBmpFinal);
DeleteDC(hBmp_FinalDC);
DeleteObject(access);
DeleteObject(photo);
DeleteDC(hdc_access);
Afficher la suite