salut
je voudrais afficher une image en vc++
mais j'ai rencontré un pb lors de l'affichage
j'ai utilisé la bibliotheque CImage
je la compile à coté puis j'additionne ces lib au mon projet
et aussi j'integre le fichier "CImage.h" au mon projet
j'ai definit un variable m_Image de classe Cimage au nomduprojet.doc
et j'ecris cette instruction:
cette instruction pour ouvrir la boite de dialog
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 BOOL CJbilooooooooDoc::OnOpenDocument(LPCTSTR lpszPathName) { if (!CDocument::OnOpenDocument(lpszPathName)) return FALSE; // TODO: Add your specialized creation code here m_image.LoadFile(lpszPathName); SetCurrentDirectory("./data/"); return TRUE; }
quand j'execute , j'aurrais cet erreur:
--------------------Configuration: jbiloooooooo - Win32 Debug--------------------
Compiling...
jbilooooooooDoc.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\jbiloooooooo\jbilooooooooDoc.cpp(112) : error C2228: left of '.LoadFile' must have class/struct/union type
Error executing cl.exe.
jbiloooooooo.exe - 1 error(s), 0 warning(s)
et pour l'affichage j'utilie la fonction:
est que quelqu'un peut m'aider???????????
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 void CJbilooooooooView::OnDraw(CDC* pDC) { CJbilooooooooDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here pDoc->m_image->Draw(pDC,0,0,0,0); //pDoc->m_image.Draw(pDC,CRect(0,0,0,0)); }
Partager