获取字符串宽度Graphics::MeasureString

获取字符串宽度Graphics::MeasureString
//获取字符串宽度
int GetStrWidth(Graphics *g,char *str,Font * pfont)
{
 RectF outrect;
 _bstr_t pstr = str;
 g->MeasureString(pstr,pstr.length(),g_pDefaultFont,RectF(0,0,0,0),&outrect);
 return outrect.Width;
}

你可能感兴趣的:(获取字符串宽度Graphics::MeasureString)