翻譯|使用教程|編輯:況魚(yú)杰|2019-11-26 10:06:30.050|閱讀 238 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常見(jiàn)問(wèn)題,教程整理的很齊全,非常適合新手學(xué)習(xí)。本文將會(huì)展示如何提示用戶插入和旋轉(zhuǎn)實(shí)體數(shù)組。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
VectorDraw Developer Framework(VDF)是一個(gè)用于應(yīng)用程序可視化的圖形引擎庫(kù)。有了VDF提供的功能,您可以輕松地創(chuàng)建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。
VectorDraw Developer Framework試用版下載
問(wèn):
如何在WebControl中更改實(shí)體的圖層?
答:
這是有關(guān)如何更改實(shí)體層的示例:
首先需要?jiǎng)?chuàng)建一個(gè)紅色圖層和一條顏色為bylayer的線。
然后,調(diào)用_vdmousedown,在此處再次創(chuàng)建綠色的新層。
再使用新圖層的手柄,當(dāng)我們單擊該行時(shí),將新圖層更改為舊圖層的手柄。
因此,現(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(); } }
對(duì)于以上問(wèn)答,如果您有任何的疑惑都可以在評(píng)論區(qū)留言,我們會(huì)及時(shí)回復(fù)。此系列的問(wèn)答教程我們會(huì)持續(xù)更新,如果您感興趣,可以多多關(guān)注本教程。
熱門文章推薦:
如果您對(duì)想要購(gòu)買正版授權(quán)VectorDraw Developer Framework(VDF),可以聯(lián)系咨詢相關(guān)問(wèn)題。
關(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)載自: