But might differ depending the uformat parameter see table
Fonts, Bitmaps, and Regions 89
NOTE
TextOut, while useful, isn’t very good at formatting
text. I usually use it to dis-play diagnostic information on-screen, like the mouse position or the frame rate.
DrawText Parameter Purpose
hDC The destination device context
TeamLRN
|
|
---|
A DrawText Example
Another sample program? Sure, why not! IsoHex3_2.cpp (which is just a slightly modified IsoHex3_1.cpp) makes use of DrawText. The differences lie totally in Prog_Init.{
//retrieve the client rectangle
RECT rcClient;
GetClientRect(hWndMain,&rcClient);
//add the paganini font to the system table
AddFontResource("Paganini.ttf");
//create a font that uses paganini
hfntNew=CreateFont(-40,0,0,0,0,0,0,0,0,0,0,0,0,"Paganini"); //borrow dc from main window
HDC hdc=GetDC(hWndMain);
//select new font into dc
hfntOld=(HFONT)SelectObject(hdc,hfntNew);