![]() ![]() // The code fragment shows how to create a font object, // select the font object into a DC (device context) for text // drawing, and finally delete the font object. // Initializes a CFont object with the specified characteristics. CFont font; VERIFY(font.CreateFont( 12, // nHeight 0, // nWidth 0, // nEscapement 0, // nOrientation FW_NORMAL, // nWeight FALSE, // bItalic FALSE, // bUnderline 0, // cStrikeOut ANSI_CHARSET, // nCharSet OUT_DEFAULT_PRECIS, // nOutPrecision CLIP_DEFAULT_PRECIS, // nClipPrecision DEFAULT_QUALITY, // nQuality DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily "Arial")); // lpszFacename // Do something with the font just created... CClientDC dc(this); CFont* def_font = dc.SelectObject(&font); dc.TextOut(5, 5, "Hello", 5); dc.SelectObject(def_font); // Done with the font. Delete the font object. font.DeleteObject(); |
'Programming > MFC' 카테고리의 다른 글
CWinThread로 UI Thread 만들기 (0) | 2006.01.06 |
---|---|
DDX (0) | 2006.01.03 |
에디트박스(Edit Box)의 폰트변경 (0) | 2006.01.03 |
Static Picture Control로 비트맵 이미지 띄우기 (0) | 2005.12.29 |
Static에 마우스 클릭 이벤트 받아오기 (0) | 2005.12.29 |