MFC笔记10
1.
CDC MemDC1;
MemDC1.SetBkMode(OPAQUE);
背景模式,VC6下面有三種:
/* Background Modes */
#define TRANSPARENT 1//透明
#define OPAQUE 2//不透明
#define BKMODE_LAST 2//上一模式,其實就是不透明
2.MFC加特定字體
你可以用系統幫助的例子試一下,如果可以就是你字體的問題.
我估計你沒有加"方正姚體"這個字庫.不過CE好像沒有這個字庫吧.
//?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
???_T("Arial")));?????????????????//?lpszFacename
//?Use?the?font?which?you?just?created.
CClientDC?dc(this);??
CFont*?def_font?=?dc.SelectObject(&font);
dc.ExtTextOut(5,?5,?ETO_OPAQUE,?NULL,?_T("Hello"),?NULL);
dc.SelectObject(def_font);
//?Finished?with?the?font,?now?delete?the?font?object.
font.DeleteObject();?
?3.c++ MFC int 轉換成 CString
int s = 123; CString str; str.Format(_T("%d"), s);4.清空CString 型變量
但是具體運用的時候只能這樣表達: CByteArray a; a.RemoveAll(); CString b; b.Empty();CString c[]={1,2,3,4,5}; for(int i=0;i<sizeof(c);i++) {c[i].Empty(); }
?
轉載于:https://www.cnblogs.com/zhangerxiaoma/p/5065748.html
總結
- 上一篇: (王道408考研操作系统)第四章文件管理
- 下一篇: HTML中的div标签