相关分类 VC技巧 ->VC ->VCShare

VC中如何把一串文字旋转90度显示?

关键字 文字旋转90度

一,新建一个单文档工程ChangeFont。
二,修改ChangeFontView::OnDraw函数,代码如下:
void CChangeFontView::OnDraw(CDC* pDC)
{
CChangeFontDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);

CFont* pFont = pDC->GetCurrentFont();
LOGFONT logFont ;
pFont->GetLogFont(&logFont);
logFont.lfEscapement = 900 ;//900/10 = 90
HFONT hFont = CreateFontIndirect(&logFont);
pDC->SelectObject(hFont);
pDC->TextOut(200,200,"VC中如何把一串文字旋转90度显示的?");
}
三。msdn对lfEscapement的解释如下:
Specifies the angle, in tenths of degrees, between the escapement vector and the x-axis of the device.tenths是十分之一的意思,degrees是角度的意

思。所以参数900表示90度。

相关文章
上一篇:SetCapture可能影响快捷键 下一篇:按Ctrl键会引发几次按键消息
置顶文章
[置顶]如何给多维数组赋初值