查看单个帖子
旧 2009-04-16, 11:49 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】[arx][求助]关于acdbtext

[arx][求助]关于acdbtext
[arx][求助]关于acdbtext
请问如何得到acdbtext的具体宽度?谢谢~~
//获得text文本的实际宽度
double gettexttruewidth(cstring stext, double dtextheight, cstring stextstyle)
{
acgitextstyle textstyle;
if(!stextstyle.isempty())
{
if(fromacdbtextstyle(textstyle, lpctstr(stextstyle)) != acad::eok) return 0.0;
}
else
{
if(fromacdbtextstyle(textstyle, acdbhostapplicationservices()->workingdatabase()->textstyle()) != acad::eok)
return 0.0;
}
textstyle.settextsize(dtextheight);
textstyle.loadstylerec();
acgepoint2d pt = textstyle.extents(lpctstr(stext), adesk::ktrue, -1, adesk::kfalse);
return pt.x;
}
使用acdbentity::getgeomextents 函数可以得到物件的在下和右上点
我的作品,您的选择//www.umould.com/thread-1637-1-1.html
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)