翻譯|使用教程|編輯:黃竹雯|2018-10-25 11:28:48.000|閱讀 392 次
概述:本教程整理了VectorDraw 最常見問題,教程整理的很齊全,非常適合新手學(xué)習(xí),希望對大家有一定的幫助!
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
VectorDraw Developer Framework(VDF)是一個用于應(yīng)用程序可視化的圖形引擎庫。有了VDF提供的功能,您可以輕松地創(chuàng)建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。該庫還支持許多矢量和柵格輸入和輸出格式,包括本地PDF和SVG導(dǎo)出。
【VectorDraw Developer Framework最新版下載】
VectorDraw web library (javascript)是一個矢量圖形庫。VectorDraw web library (javascript)不僅能打開CAD圖紙,而且能顯示任何支持HTML5標(biāo)準(zhǔn)平臺上的通用矢量對象,如Windows,安卓,iOS和Linux。無需任何安裝,VectorDraw web library (javascript)就可以運(yùn)行在任何支持canvas標(biāo)簽和Javascript的主流瀏覽器(Chrome, Firefox, Safari, Opera, Dolphin, Boat等等)中。
【VectorDraw web library (javascript)最新版下載】
一. 已編譯的項(xiàng)目無法與安裝的其他VDF版本一起使用
問:我創(chuàng)建了一個使用VectorDraw控件6009編譯的簡單應(yīng)用程序。所有VectorDraw dll引用都是使用Specific Version = false和Copy Local = false編譯的。此應(yīng)用程序僅適用于具有VectorDraw 6009的計(jì)算機(jī),如果它在VectorDraw 6011計(jì)算機(jī)上運(yùn)行則拋出異常。在項(xiàng)目中,我不使用6011中但在6009中丟失或更改的任何屬性/方法/事件?
答:注意:不建議使用以下解決方案。我們建議使用相同的VDF版本構(gòu)建和重新分發(fā)您的應(yīng)用程序。
您可以通過分發(fā)配置文件來重定向VectorDraw dll的版本。
對于VectorDraw程序集dll,配置文件必須如下所示。此外,它必須與您的應(yīng)用程序.exe放在同一目錄中,并且必須使用格式重命名(yourapplicationname.exe.config)
此配置文件將使用6.1.6011.0重定向所有版本的VectorDraw程序集(請注意,這些dll必須存在于分發(fā)計(jì)算機(jī)中)
<?xml version =“1.0”?> <configuration> <runtime> <assemblyBinding xmlns =“urn:schemas-microsoft-com:asm.v1”> <dependentAssembly> <assemblyIdentity name =“VectorDraw.Actions”publicKeyToken =“54eac14e23c9ee53 “culture =”neutral“/> <bindingRedirect oldVersion =”0.0.0.0-6.1.65535.65535“newVersion =”6.1.6011.0“/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =”VectorDraw.Generics“publicKeyToken =”54eac14e23c9ee53 “culture =”neutral“/> <bindingRedirect oldVersion =”0.0.0.0-6.1.65535.65535“newVersion =”6.1.6011.0“/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“VectorDraw.Geometry”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“VectorDraw.Render”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“RenderFormats”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“VectorDraw.Serialize”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“VDrawBaseControl”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“vdCommandLine”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion = “0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“vdFramedControl”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“VectorDraw.Professional”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“vdPropertyGrid”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“vdScrollableControl”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“WinMsgMannager”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“VectorDraw.ExDialogs”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“VectorDraw.Fonts”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“VdProControl”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“vdxFcnv”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion = “0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“OpenVDF”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“vdDXF”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion =“0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> <dependentAssembly> <assemblyIdentity name =“VdrawPro5”publicKeyToken =“54eac14e23c9ee53”culture =“neutral”/> <bindingRedirect oldVersion = “0.0.0.0-6.1.65535.65535”newVersion =“6.1.6011.0”/> </ dependentAssembly> </ assemblyBinding> </ runtime> </ configuration>
相反也是可能的,比如使用6011構(gòu)建你的exe并使其運(yùn)行6009安裝。在這種情況下,使用6011構(gòu)建項(xiàng)目時使用的屬性/方法/事件不應(yīng)從6011更改為6009。
二. 設(shè)置顯示工具提示之前的延遲時間
問:我們在我們的軟件中對某些繪圖對象使用VDraw工具提示。今天,工具提示完全顯示在光標(biāo)在對象上移動的那一刻。是否可以在顯示工具提示之前設(shè)置延遲(例如2秒)?
答:可以通過應(yīng)用程序中的代碼實(shí)現(xiàn),如下所示。您將需要一個將在MouseMove事件上啟動的Timer,并且在計(jì)時器代碼上將顯示一個代碼,該代碼將顯示工具提示。這樣,工具提示將在設(shè)置為計(jì)時器的時間間隔之后顯示,并且鼠標(biāo)不在實(shí)體上移動。
//On Form Load we initialize the events. //Note that EnableTooltips is set to False!!!!! private void Form1_Load(object sender, EventArgs e) { //........ vdFramedControl.BaseControl.MouseMove += new MouseEventHandler(BaseControl_MouseMove); mTimer.Interval = 5000; mTimer.Tick += new EventHandler(mTimer_Tick); vdFramedControl.BaseControl.ActiveDocument.EnableToolTips = false; mTimer.Start(); } //On mouse move we constantly reset the timer void BaseControl_MouseMove(object sender, MouseEventArgs e) { mTimer.Stop(); mTimer.Start(); } //On the timer's code we write the following in order to show the tooltip void mTimer_Tick(object sender, EventArgs e) { if (!vdFramedControl.BaseControl.Visible) return; if (vdFramedControl.BaseControl.ActiveDocument.ActiveLayOut.OverAllActiveActions.Count > 1) return; VectorDraw.Actions.BaseAction action = vdFramedControl.BaseControl.ActiveDocument.ActiveLayOut.OverAllActiveAction; if (!action.IsVisible) return; vdFramedControl.BaseControl.ActiveDocument.EnableToolTips = true; //This will show the tooltip if there is any!!!! action.MouseMove(new MouseEventArgs(MouseButtons.None, 0, action.GdiMouseLocation.X, action.GdiMouseLocation.Y, 0), action.MouseLocation, action.OrthoPoint); vdFramedControl.BaseControl.ActiveDocument.EnableToolTips = false; } //Don't forget to do the finalizations at the closing of the application protected override void OnClosing(CancelEventArgs e) { mTimer.Tick -= new EventHandler(mTimer_Tick); vdFramedControl.BaseControl.MouseMove -= new MouseEventHandler(BaseControl_MouseMove); mTimer.Stop(); mTimer.Dispose(); base.OnClosing(e); }
三. 過濾選擇文檔特定布局的所有圖層的所有折線
問:如何過濾選擇文檔特定布局的所有圖層的所有折線?
答:可通過以下代碼實(shí)現(xiàn):
//Create a selection VectorDraw.Professional.vdCollections.vdSelection selset = new vdSelection("Myselset"); selset.SetUnRegisterDocument(vdFramedControl1.BaseControl.ActiveDocument); //Create a filter VectorDraw.Professional.vdObjects.vdFilterObject filter = new vdFilterObject(); //Add ALL Layer names to the filter(you can add simply 1 layer if you want foreach (vdLayer var in vdFramedControl1.BaseControl.ActiveDocument.Layers) { filter.Layers.AddItem(var.Name); } //Add vdPolyline to select all polylines filter.Types.AddItem("vdPolyline"); //Add the name of the layout you want to check if no name is specified then ALL layouts will be checked filter.LayOuts.AddItem(vdFramedControl1.BaseControl.ActiveDocument.ActiveLayOut.Name); //Apply the filter. After this the selection will contain the selected polylines. selset.FilterSelect(filter);
四. 不想顯示選擇交叉綠色和窗口藍(lán)色矩形以及不在夾點(diǎn)選擇中添加的所選實(shí)體
問:我不想顯示選擇交叉綠色和窗口藍(lán)色矩形以及不在夾點(diǎn)選擇中添加的所選實(shí)體,可以怎么做?
答:應(yīng)用程序表單中的帶有vdFrameControl的C#中的示例:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using VectorDraw.Professional.vdCollections; namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); //do not show the green and blue selecting colors vdFramedControl1.BaseControl.ActiveDocument.GlobalRenderProperties.SelectingCrossColor = Color.Empty; vdFramedControl1.BaseControl.ActiveDocument.GlobalRenderProperties.SelectingWindowColor = Color.Empty; vdFramedControl1.BaseControl.ActiveDocument.OnFilterFigure += new VectorDraw.Professional.vdObjects.vdDocument.FilterFigureEventHandler(ActiveDocument_OnFilterFigure); } void ActiveDocument_OnFilterFigure(object sender, VectorDraw.Professional.Constants.VdConstFilterFig JobId, VectorDraw.Professional.vdPrimaries.vdFigure fig, ref bool cancel) { //do not add the entities in default vdraw grip selections. if (JobId != VectorDraw.Professional.Constants.VdConstFilterFig.FILTERFIG_SELECT) return; if (fig == null) return; vdSelection gripset = sender as vdSelection; if (gripset == null) return; if (!gripset.Name.StartsWith("VDGRIPSET")) return; cancel = true; //throw new Exception("The method or operation is not implemented."); } } }
未完待續(xù)......
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn