翻譯|使用教程|編輯:況魚杰|2019-08-12 10:01:09.957|閱讀 353 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常見(jiàn)問(wèn)題,教程整理的很齊全,非常適合新手學(xué)習(xí),本節(jié)教程將會(huì)介紹如何在cmdText啟動(dòng)之前設(shè)置文本的高度。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
VectorDraw Developer Framework(VDF)是一個(gè)用于應(yīng)用程序可視化的圖形引擎庫(kù)。有了VDF提供的功能,您可以輕松地創(chuàng)建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。
VectorDraw Developer Framework試用版下載
問(wèn):
是否存在文檔的全局/默認(rèn)文本高度?當(dāng)用戶想要輸入高度值時(shí),它無(wú)法被用戶創(chuàng)建此vdtext時(shí)的當(dāng)前vdtext改變,用戶如何才能在cmdText啟動(dòng)之前設(shè)置文本的高度?
答:
此項(xiàng)功能是存在的,想要達(dá)到此效果,請(qǐng)參閱以下代碼:
private void button3_Click(object sender, EventArgs e) { vdDocument doc = vdFramedControl1.BaseControl.ActiveDocument; doc.New(); cmdTextWithHeight(doc, null, null, null, 5.0); cmdTextWithHeight(doc, "VDF version6", new gPoint(30,30), null, 15.0); cmdTextWithHeight(doc, null, new gPoint(10,10), 0.0d, 25.0); cmdTextWithHeight(doc, "hi", null, 30.0, 35.0); } private bool cmdTextWithHeight(vdDocument document, object TextString, object InsertionPoint, object RotationAngle, double TextHeight) { bool ret = false; double oldheight = document.ActiveTextStyle.Height; // store the old value to set this back after this finishes document.ActiveTextStyle.Height = TextHeight;// set the Height that is needed to activetextstyle if (document.CommandAction.CmdText(TextString, InsertionPoint, RotationAngle)) { vdText txt = document.ActiveLayOut.Entities[document.ActiveLayOut.Entities.Count - 1] as vdText; // get the text that was just created if (txt != null) { //... do other things there with the just-created-vdText if you like !! txt.Height = TextHeight; // see it to the Height so evene if activeTextStyle changes this remains. ret = true; } } document.ActiveTextStyle.Height = oldheight; // set the original value back. return ret; }
關(guān)注慧聚IT微信公眾號(hào) ???,了解產(chǎn)品的最新動(dòng)態(tài)及最新資訊。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: