Dessiner un texte dans un hwnd en mode non erase..

JackosKing Messages postés 168 Date d'inscription mardi 31 décembre 2002 Statut Membre Dernière intervention 21 avril 2005 - 5 sept. 2003 à 02:51
JackosKing Messages postés 168 Date d'inscription mardi 31 décembre 2002 Statut Membre Dernière intervention 21 avril 2005 - 5 sept. 2003 à 11:53
lo,

voilà pour le moment j'utilisai ceci pour dessiner un texte dans un bdg:

char buf[10];
//		SYSTEMTIME CurrentTime;
HFONT hFont;
hFont=CreateFont(12,0,0,0,500,FALSE,FALSE,FALSE,0,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_DONTCARE,"Verdana");
HBITMAP hBmp;
HDC hDC;
hBmp=(HBITMAP)LoadImage(NULL,"C:\\Julien\\TinyShell\\Datas\\SmallBar.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
hDC=GetDC(hwnd);
DrawState(hDC,NULL,NULL,(LPARAM)hBmp,NULL,0,0,0,0,DST_BITMAP);
DeleteObject(hBmp);

//		hDC=BeginPaint(hWnd,&paintst);
SelectObject(hDC,hFont);
//		GetLocalTime(&CurrentTime);

//		sprintf(buf,"%dh%02dmin",CurrentTime.wHour,CurrentTime.wMinute);
TextOut(hDC,10,0,"buf",strlen("buf"));

//		EndPaint(hWnd,&paintst);
DeleteObject(hFont);

ReleaseDC(hwnd,hDC);

Le probleme c'est que ca dessine le texte en mode ERASE, et donc j'ai un beau rectangle blanc...
est il possible de faire autrement, afin de ne pas aboir ce prob?
thx

JackosKing For EvEr

2 réponses

BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019
5 sept. 2003 à 08:32
SetBkMode(hdc, TRANSPARENT);
Ensuite y a un tas d'autres options, ex:
SetTextColor(hdc, 255);
SetTextAlign(hdc, TA_BASELINE | TA_CENTER);
etc...
BruNews, ciao...
0
JackosKing Messages postés 168 Date d'inscription mardi 31 décembre 2002 Statut Membre Dernière intervention 21 avril 2005
5 sept. 2003 à 11:53
merci :p
JackosKing For EvEr
0
Rejoignez-nous