j'utilise l'icone de l'image en rectangle , je lui alloue une variable membre en etant juste un controle et non une value.
si tu peux m'aider a changer le nbr de couleur merci.
voici mon code pour charger et afficher l'image:
CBitmap Bitmap;
CRect rect1;
CDC DCMem;
m_img_princ.GetClientRect(rect1);
CDC *pBmpDC = m_img_princ.GetWindowDC();
HBITMAP hBitmap=(HBITMAP)LoadImage(NULL, m_chemin,IMAGE_BITMAP,0,0, LR_DEFAULTSIZE|LR_LOADFROMFILE);
Bitmap.Attach(hBitmap);
BITMAP InfosBmp;
Bitmap.GetBitmap(&InfosBmp);
DCMem.CreateCompatibleDC(pBmpDC);
DCMem.SelectObject(&Bitmap);
pBmpDC->StretchBlt( NULL , 0,rect1.Width(),rect1.Height(),&DCMem,0, 0,InfosBmp.bmWidth, InfosBmp.bmHeight,SRCCOPY);
m_img_princ.ReleaseDC(pBmpDC);
m_img_princ.InvalidateRect(rect1,FALSE);
ou je dois changer mon code pour l'afficher comme tu as dit si c'est possible bien sur.