Affichage mfc

Résolu
hakker Messages postés 23 Date d'inscription vendredi 15 février 2008 Statut Membre Dernière intervention 20 février 2010 - 28 févr. 2008 à 21:57
yann_lo_san Messages postés 1137 Date d'inscription lundi 17 novembre 2003 Statut Membre Dernière intervention 23 janvier 2016 - 29 févr. 2008 à 22:20
hello i have some trouble in "l'affichage en mfc" everytime i try C...View::onDraw ()
some mistakes shows up incompiling
and i cant find a way  to fix it!
can somebody would plz tell me how can we use DrawText() function ! i dont understund it's parametre!!
plz help me!!!!!!!!!!!

nice working with u all guz!!

1 réponse

yann_lo_san Messages postés 1137 Date d'inscription lundi 17 novembre 2003 Statut Membre Dernière intervention 23 janvier 2016 26
29 févr. 2008 à 22:20
CYourClassView::OnDraw(CDC* pDC) give you a 'device context' for painting all existing graphics object like pen, brush, bitmap ect...
pDC is the access to the device.
For drawing text, just pass a string , a reference to a rect and one format.

// Zone to paint text in client window
RECT rcDraw;
::SetRect(&rcDraw, 5, 5, 100, 40);
// draw text with no clip

pDC->DrawText(_T("a string"),&rcDraw,DT_NOCLIP);

On the same way look at : ExtTextOut and TextOut
3
Rejoignez-nous