[求助]新建图形数据库中文字居中错误
<p>我在用 new AcDbDatabase 创建的图形数据库中,用AcDbText创建文本标注,但设成水平中心对齐后显示位置不对,苦苦研究了两天,就是解决不了,同样的代码在打开的图形数据库则正常,请各位虾救救我吧!</p><p>以下两段代码都不行</p><p>代码1:</p><p> AcDbText *pText=new AcDbText;<br/> pText->setHorizontalMode(AcDb::kTextCenter);<br/> pText->setAlignmentPoint(PointZDH);<br/> pText->setTextString(m_szDrawZDH);<br/> pText->setTextStyle(TextStyleZDH);<br/> pText->setHeight(2.5*m_DrawScale);<br/> pText->setRotation(0.0);</p><p> AcDbObjectId textId;<br/> pBlockTableRecord->appendAcDbEntity(textId,pText);<br/> pText->adjustAlignment(m_pDb);<br/> pText->close();</p><p>代码2:<br/> AcDbText *pText=new AcDbText(PointZDH,m_szDrawZDH,TextStyleZDH,2.5*m_DrawScale);<br/> AcDbObjectId textId;<br/> pBlockTableRecord->appendAcDbEntity(textId,pText);<br/> pText->setHorizontalMode(AcDb::kTextMid);<br/> pText->setAlignmentPoint(PointZDH);<br/> pText->setColorIndex(m_DrawColor);<br/> pText->setLayer(m_LayerZJ);<br/> pText->setWidthFactor(0.8);<br/> pText->adjustAlignment(m_pDb);<br/> pText->close();</p>
页:
[1]