0
点赞
收藏
分享

微信扫一扫

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

Separes 2022-07-27 阅读 58


                                                               ​​何志丹​​

一,新建一个单文档工程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度。

举报

相关推荐

0 条评论