two-ampersand (&&) mnemonic-prefix characters as a directive to print a single ampersand. By specifying DT_NOPREFIX, this processing is turned off.
?
?
? DT_PATH_ELLIPSIS DT_RIGHT右对齐 Aligns text flush-right. DT_SINGLELINE单行输出 Specifies single line only. Carriage returns and
linefeeds do not break the line.
? DT_TABSTOP设置TAB字符所占宽度 Sets tab stops. The high-order byte of
nFormat is the number of characters for each tab. The default number of characters per tab is eight.
?
? DT_TOP定部对齐 Specifies top-justified text (single line only). DT_VCENTER中部对齐 Specifies vertically centered text (single line
only).
? DT_WORDBREAK每行只在单词间被折行 Specifies word-breaking. Lines are
automatically broken between words if a word would extend past the edge of the rectangle specified by lpRect. A carriage return杔inefeed sequence will also break the line.
在输出文字时如果希望改变文字的颜色,你可以利用CDC::SetTextColor( COLORREF
crColor )进行设置,如果你希望改变背景色就利用CDC::SetBkColor( COLORREF crColor ),很多时候你可能需要透明的背景色你可以利用CDC::SetBkMode( int nBkMode )设置,可接受的参数有
? OPAQUE Background is filled with the current background color before the
text, hatched brush, or pen is drawn. This is the default background mode. ? TRANSPARENT Background is not changed before drawing.
接下来讲讲如何创建字体,你可以创建的字体有两种:库存字体
CDC::CreateStockObject( int nIndex )和自定义字体。
在创建非库存字体时需要填充一个LOGFONT结构并使用CFont::CreateFontIndirect(const LOGFONT* lpLogFont ),或使用CFont::CreateFont( int nHeight, int nWidth, int nEscapement, int nOrientation, int nWeight, BYTE bItalic, BYTE bUnderline, BYTE cStrikeOut, BYTE nCharSet, BYTE nOutPrecision, BYTE nClipPrecision, BYTE nQuality, BYTE nPitchAndFamily, LPCTSTR lpszFacename )其中的参数和LOGFONT中的分量有一定的对应关系。下面分别讲解参数的意义:
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-35251-8.html
想讹钱