字体:获取字体尺寸

来源:互联网 发布:淘宝买家超级会员等级 编辑:程序博客网 时间:2024/04/30 12:16
//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);

0 0
原创粉丝点击