//Gdiplus::Font grFont(_TEXT("微软雅黑"), 14);
StringFormat stringformat(StringAlignmentNear);
// 接收字体的显示区域,如宽高
Gdiplus::Font font(m_PaintManager.GetPaintDC(), m_PaintManager.GetFont(0));
GraphicsPath path;
FontFamily fontfamily;
font.GetFamily(&fontfamily);
path.AddString(strCount.c_str(),-1,&fontfamily,font.GetStyle(),font.GetSize(),PointF(0,0),&stringformat);
RectF rcBound;
path.GetBounds(&rcBound);
字体:获取字体尺寸
最新推荐文章于 2022-10-07 21:43:22 发布