hihi j'avais deja vu cette réponse avant, je ne sais pas si elle était déja de toi :p
Mais elle ne marche pas, en effet je ne sais pas coment déclarere le MyImage...
en sachant que moi j'ai :
void CEssaiDlg::ChargeImage(int m_nSelectedItem)
{
//Nouvelle fonction utilisant la bibliothèque gdi+
using namespace Gdiplus;
CString sDossier;
CString strPath;
int m_nLargeurImageSource,m_nHauteurImageSource;
//double m_fRapportImage;
//double m_fAgrandissement;
LPCWSTR pszWide;
// Lecture du fichier image
strPath=m_VectorImageNames[m_nSelectedItem];
USES_CONVERSION;
pszWide= A2CW(strPath); //utilisation des macro de conversion string vers const wchar*
//Chargement de l'image
Bitmap BitmapSource(pszWide); //Chargement de l'image
//Dimensions de l'image source
m_nLargeurImageSource=BitmapSource.GetWidth();
m_nHauteurImageSource=BitmapSource.GetHeight();
AfficheImage(&BitmapSource);
}
void CEssaiDlg::AfficheImage(Bitmap *BitmapAffiche)
{
//La variable m_bAfficheImage peut être utilisée pour autoriser l'affichage de l'image
//Surface d'affichage
CDC* pDC= m_cImageRect.GetDC();
//Définition de l'objet graphique
CRect m_Rect;
//m_cImageRect.GetWindowRect(&m_Rect);
m_cImageRect.GetClientRect(&m_Rect);
Graphics graphicAffiche(pDC->m_hDC);
CBrush brush;
brush.CreateSolidBrush(RGB(0,0,0));
//fond noir
pDC->FillRect(m_Rect,&brush); //On a pris le getdc de m_cImageRect donc le pt 0,0 est le bord de m_cImageRect
//image
//graphics.DrawImage(image, ImageDesRectf, SrcRectf,UnitPixel,NULL);
/*CDC* pDC=m_cImageRect.GetDC();
HDC hDCImage=CreateCompatibleDC(*pDC);
SelectObject(*hDCImage,BmpResu);
BitBlt(pDC,m_RectImage.left,m_RectImage.top,m_RectImage.Width(),m_RectImage.Height(),hDCImage,0,0,SRCCOPY);
*/
graphicAffiche.DrawImage(BitmapAffiche,m_Rect.left,m_Rect.top,m_Rect.Width(),m_Rect.Height());
}
void CEssaiDlg::OnCopier()
{
// TODO: Add your control notification handler code here
}