翻譯|使用教程|編輯:況魚杰|2019-11-26 10:06:30.050|閱讀 238 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常見問題,教程整理的很齊全,非常適合新手學習。本文將會展示如何提示用戶插入和旋轉(zhuǎn)實體數(shù)組。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
VectorDraw Developer Framework(VDF)是一個用于應用程序可視化的圖形引擎庫。有了VDF提供的功能,您可以輕松地創(chuàng)建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。
VectorDraw Developer Framework試用版下載
問:
如何在WebControl中更改實體的圖層?
答:
這是有關(guān)如何更改實體層的示例:
首先需要創(chuàng)建一個紅色圖層和一條顏色為bylayer的線。
然后,調(diào)用_vdmousedown,在此處再次創(chuàng)建綠色的新層。
再使用新圖層的手柄,當我們單擊該行時,將新圖層更改為舊圖層的手柄。
因此,現(xiàn)在該行已從新層移至new2。
function test() { //create a new layer var newLayer = vdcanvas.AddLayer("new"); newLayer.PenColor = vdConst.colorFromString("255,0,0"); //set active the layer in order the new entities that will be added to have the newlayer as reference vdcanvas.SetActiveLayer(newLayer); //set the color of new added entities to be bylayer color vdcanvas.SetActivePenColor(vdConst.colorFromString("bylayer")); var line = vdcanvas.AddLine([1, -1, 0], [1, 1, 0], true); vdcanvas.vdmousedown = _vdmousedown; } function _vdmousedown(e) { if (vdcanvas.ActiveAction().IsStarted()) return; //check if user mouse click and no action is active(like move , pan etc) var entity = e.target.GetEntityFromPoint(e.xPix, e.yPix); if (entity != null) { //create a new layer with color green var newLayer2 = vdcanvas.AddLayer("new2"); newLayer2.PenColor = vdConst.colorFromString("0,255,0"); //get the handle of the layer used by entities 'Layer' property var handle2 = "h_" + newLayer2.HandleId.toString(); entity.Layer = handle2;//change the layer to new one. vdcanvas.UpdateFig(entity); //needed in order the entity get the change //draw the entity over the screen vdcanvas.DrawEntity(entity); vdcanvas.Refresh(); } }
對于以上問答,如果您有任何的疑惑都可以在評論區(qū)留言,我們會及時回復。此系列的問答教程我們會持續(xù)更新,如果您感興趣,可以多多關(guān)注本教程。
熱門文章推薦:
如果您對想要購買正版授權(quán)VectorDraw Developer Framework(VDF),可以聯(lián)系咨詢相關(guān)問題。
關(guān)注慧聚IT微信公眾號 ???,了解產(chǎn)品的最新動態(tài)及最新資訊。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: