翻譯|使用教程|編輯:況魚杰|2019-11-26 10:06:30.050|閱讀 238 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常見問題,教程整理的很齊全,非常適合新手學習。本文將會展示如何提示用戶插入和旋轉實體數組。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
VectorDraw Developer Framework(VDF)是一個用于應用程序可視化的圖形引擎庫。有了VDF提供的功能,您可以輕松地創建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。
VectorDraw Developer Framework試用版下載
問:
如何在WebControl中更改實體的圖層?
答:
這是有關如何更改實體層的示例:
首先需要創建一個紅色圖層和一條顏色為bylayer的線。
然后,調用_vdmousedown,在此處再次創建綠色的新層。
再使用新圖層的手柄,當我們單擊該行時,將新圖層更改為舊圖層的手柄。
因此,現在該行已從新層移至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(); } }
對于以上問答,如果您有任何的疑惑都可以在評論區留言,我們會及時回復。此系列的問答教程我們會持續更新,如果您感興趣,可以多多關注本教程。
熱門文章推薦:
如果您對想要購買正版授權VectorDraw Developer Framework(VDF),可以聯系咨詢相關問題。
關注慧聚IT微信公眾號 ???,了解產品的最新動態及最新資訊。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自: