[ARX][求助]关于acdbText
请问如何得到acdbText的具体宽度?谢谢~~ <P>//获得TEXT文本的实际宽度<BR>double GetTextTrueWidth(CString sText, double dTextHeight, CString sTextStyle)<BR>{<BR> AcGiTextStyle TextStyle;<BR> if(!sTextStyle.IsEmpty())<BR> {<BR> if(fromAcDbTextStyle(TextStyle, LPCTSTR(sTextStyle)) != Acad::eOk) return 0.0;<BR> }<BR> else<BR> {<BR> if(fromAcDbTextStyle(TextStyle, acdbHostApplicationServices()->workingDatabase()->textstyle()) != Acad::eOk) <BR> return 0.0;<BR> }<BR> TextStyle.setTextSize(dTextHeight);<BR> TextStyle.loadStyleRec();<BR> AcGePoint2d Pt = TextStyle.extents(LPCTSTR(sText), Adesk::kTrue, -1, Adesk::kFalse);</P><P> return Pt.x;<BR>}<BR></P> 使用AcDbEntity::getGeomExtents 函数可以得到物件的在下和右上点<br/>
页:
[1]