Meir Rivkin
asked on
DC question
i'm using ExtTextOut() to draw a rectangle and put string in it.
pDC->SetBkColor(RGB(255,25 5,128));
pDC->ExtTextOut(coordX ,coordY, ETO_CLIPPED, NULL, szText, NULL);
how do i change the font and the color to be like the tooltip ?
pDC->SetBkColor(RGB(255,25
pDC->ExtTextOut(coordX ,coordY, ETO_CLIPPED, NULL, szText, NULL);
how do i change the font and the color to be like the tooltip ?
ASKER
robpitt:
my compiler doesn't familiar with INFOBK and INFOTEXT...?
my compiler doesn't familiar with INFOBK and INFOTEXT...?
ASKER
ok got it, should be COLOR_INFOBK and COLOR_TEXT
ASKER
i get an error:
error C2582: 'CFont' : 'operator =' function is unavailable
in this line:
oldfont=pDC->SelectObject( font);
???
error C2582: 'CFont' : 'operator =' function is unavailable
in this line:
oldfont=pDC->SelectObject(
???
Try adding a "&" i.e.
SelectObject(&font)
SelectObject(&font)
ASKER
ok its working but one more question, how to add a black border?
FrameRect
ASKER
right but in FrameRect u need to give a rectangle but as u can see below i'm using ExtTextOut() which calculating the rect according to the length of the given string, the recrangle offset is the firsyt 2 arguments (coordX and coordY), so how can i retrieve this rectangle for the FrameRect?
ASKER
u answer me that and u get 100 pts
ASKER
u answer me that and u get 100 pts
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
robpitt: thank u mate
NONCLIENTMETRICS ncm;
CFont font,oldfont;
ncm.cnSize=sizeof(ncm);
SystemParametersInfo(SPI_G
font.CreateFontIndirect(&n
pDC->SetBkColor(GetSysColo
pDC->SetTextColor(GetSysCo
oldfont=pDC->SelectObject(
pDC->ExtTextOut(....)
pDC->SelectObject(oldfont)