没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
翻译|使用教程|编辑:黄竹雯|2018-11-26 13:45:00.000|阅读 286 次
概述:本教程整理了VectorDraw 最常见问题,教程整理的很齐全,非常适合新手学习,希望对大家有一定的帮助!
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
相关链接:
VectorDraw Developer Framework(VDF)是一个用于应用程序可视化的图形引擎库。有了VDF提供的功能,您可以轻松地创建、编辑、管理、输出、输入和打印2D和3D图形文件。该库还支持许多矢量和栅格输入和输出格式,包括本地PDF和SVG导出。
【VectorDraw Developer Framework最新版下载】
VectorDraw web library (javascript)是一个矢量图形库。VectorDraw web library (javascript)不仅能打开CAD图纸,而且能显示任何支持HTML5标准平台上的通用矢量对象,如Windows,安卓,iOS和Linux。无需任何安装,VectorDraw web library (javascript)就可以运行在任何支持canvas标签和Javascript的主流浏览器(Chrome, Firefox, Safari, Opera, Dolphin, Boat等等)中。
【VectorDraw web library (javascript)最新版下载】
一. 在用户激活视口时更改视口的颜色
问:当用户通过双击激活视口时,如何更改视口的颜色?
答:在“Collections”示例中添加ActionLayoutActivated事件并编写类似的代码:
VectorDraw.Professional.vdObjects.vdColor oldcolor = new VectorDraw.Professional.vdObjects.vdColor(); // there will store the color before the "highlight" VectorDraw.Professional.vdObjects.vdHandle deactivated_Viewport_handle = new VectorDraw.Professional.vdObjects.vdHandle(); // The handle of the Viewport we changed void ActiveDocument_ActionLayoutActivated(object sender, VectorDraw.Professional.vdPrimaries.vdLayout deactivated, VectorDraw.Professional.vdPrimaries.vdLayout activated) {// fires when the Layout or the Viewport changes if (activated.ActiveViewPort == null) // Run when MODEL is activated that happens when the viewport is activated or user returns to Model. { if (deactivated.ActiveViewPort != null) // the deactiveted vieport is the one that the use dbl-clicked { oldcolor.CopyFrom(deactivated.ActiveViewPort.PenColor); // store the color deactivated.ActiveViewPort.PenColor.SystemColor = Color.Red; // change the color deactivated.ActiveViewPort.Update(); deactivated.ActiveViewPort.Invalidate(); deactivated_Viewport_handle = deactivated.ActiveViewPort.Handle; // store the handle } if ((deactivated.ActiveViewPort == null) && (deactivated_Viewport_handle.Value != 0)) // This happens when the Viewport is not "active" {//create a vdViewport and set it to the viewport that was deactivated VectorDraw.Professional.vdFigures.vdViewport deactiViewport = new VectorDraw.Professional.vdFigures.vdViewport(); deactiViewport= vdFramedControl1.BaseControl.ActiveDocument.FindFromHandle(deactivated_Viewport_handle, typeof(VectorDraw.Professional.vdPrimaries.vdFigure)) as VectorDraw.Professional.vdFigures.vdViewport; deactiViewport.PenColor.CopyFrom(oldcolor); // change the color back if (deactiViewport.ClipObj != null) { deactiViewport.ClipObj.PenColor.CopyFrom(oldcolor); // to the ClipObj too deactiViewport.ClipObj.Update(); deactiViewport.ClipObj.Invalidate(); } deactiViewport.Update(); deactiViewport.Invalidate(); deactivated_Viewport_handle= new VectorDraw.Professional.vdObjects.vdHandle(0); // set the handle to 0 } } }
二. 在包装器中使用AlignToView和AlignToViewSize
问:如何在包装器中使用AlignToView和AlignToViewSize?
答:本文适用于6014及以上版本。使用VectorDraw.Professional.tlb,在VB6项目上只需添加一个vdraw包装器和2个按钮以及如下代码:
Private Sub Command6_Click() Dim txt As VDrawI5.vdText Dim AlignObject As VectorDraw_Professional.IAlignToView Set txt = VD.ActiveDocument.entities.AddText("aaBB", Array(10, 10), 1) VD.CommandAction.CmdRect Array(9.5, 9.5), Array(14, 11.5) VD.CommandAction.Zoom "E", 0, 0 Set AlignObject = txt.WrapperObject ' set this text to be always parallel to the view. AlignObject.AlignToView = True AlignObject.AlignToViewSize = 20 'text size always the same, size in pixels End Sub Private Sub Command7_Click() VD.CommandAction.View3D "VROT" End Sub
三. 在移动鼠标的同时在光标周围画一个圆圈
问:我想在移动鼠标时围绕光标画一个圆圈。我没有任何主动操作,我尝试使用MouseMove事件,但结果不正确。我该怎么做呢 ?
答:你应该使用在没有任何活动操作的情况下触发的OnActionDraw事件。试试如下代码:
void ActiveDocument_OnActionDraw(object sender, object action, bool isHideMode, ref bool cancel) { VectorDraw.Actions.BaseAction act = action as VectorDraw.Actions.BaseAction; VectorDraw.Geometry.gPoint currentpoint = act.OrthoPoint; VectorDraw.Professional.vdFigures.vdCircle circle = new VectorDraw.Professional.vdFigures.vdCircle(); circle.SetUnRegisterDocument(vdSC.BaseControl.ActiveDocument); circle.setDocumentDefaults(); circle.Center = currentpoint; circle.Radius =2.0; circle.Draw(act.Render); }
四. 像cmdCircle那样创建自己的命令
问:我想像cmdCircle那样创建自己的命令,但没有cmdCircle显示的rubber radious。我该怎么做 ?
答:你需要创建自己的cmd-circle而不是使用我们的cmdCircle。例如,在表单中的空C#项目中添加一个vdScrollable控件(名为vdSC)和一个按钮并使用如下代码:
bool onMycmdCircle = false; VectorDraw.Geometry.gPoint cent = new VectorDraw.Geometry.gPoint(); private void Form1_Load(object sender, EventArgs e) { this.vdSC.BaseControl.ActiveDocument.ShowUCSAxis = false; this.vdSC.BaseControl.ActiveDocument.FreezeEntityDrawEvents.Push(false); this.vdSC.BaseControl.ActiveDocument.OnActionDraw += new VectorDraw.Professional.vdObjects.vdDocument.ActionDrawEventHandler(ActiveDocument_OnActionDraw); } void ActiveDocument_OnActionDraw(object sender, object action, bool isHideMode, ref bool cancel) { //here we draw the rubber circle if (action is VectorDraw.Actions.ActionGetPoint && onMycmdCircle) { VectorDraw.Actions.BaseAction act = action as VectorDraw.Actions.BaseAction; VectorDraw.Geometry.gPoint refpoint = act.ReferencePoint; VectorDraw.Geometry.gPoint currentpoint = act.OrthoPoint; VectorDraw.Professional.vdFigures.vdCircle circle = new VectorDraw.Professional.vdFigures.vdCircle(); circle.SetUnRegisterDocument(vdSC.BaseControl.ActiveDocument); circle.setDocumentDefaults(); circle.Center = cent; circle.Radius = circle.Center.Distance3D(currentpoint); circle.Draw(act.Render); } else { return; } return; } private void button2_Click(object sender, EventArgs e) { VectorDraw.Geometry.gPoint pt_cent = new VectorDraw.Geometry.gPoint(); VectorDraw.Geometry.gPoint pt_ref = new VectorDraw.Geometry.gPoint(); object status_cen = vdSC.BaseControl.ActiveDocument.ActionUtility.getUserPoint(out pt_cent); vdSC.BaseControl.ActiveDocument.ActiveLayOut.User2WorldMatrix.TransformPt(pt_cent, cent); if (status_cen != null && (VectorDraw.Actions.StatusCode)status_cen == VectorDraw.Actions.StatusCode.Success) { onMycmdCircle = true; object status_ref = vdSC.BaseControl.ActiveDocument.ActionUtility.getUserPoint(out pt_ref); onMycmdCircle = false; if (status_ref != null && (VectorDraw.Actions.StatusCode)status_ref == VectorDraw.Actions.StatusCode.Success) { //VectorDraw.Geometry.gPoint cent = new VectorDraw.Geometry.gPoint(); double radious = 0; VectorDraw.Geometry.gPoint refp = new VectorDraw.Geometry.gPoint(); vdSC.BaseControl.ActiveDocument.ActiveLayOut.User2WorldMatrix.TransformPt(pt_ref, refp); radious = refp.Distance3D(cent); vdSC.BaseControl.ActiveDocument.CommandAction.CmdCircle(cent, radious); } } }
未完待续~
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com
DevExpress v25.1帮助文档正式发布上线了,请按版本按需下载~
本教程将为大家介绍如何使用MyEclipse创建企业应用项目目,欢迎下载最新版IDE体验!
本文主要介绍DevExpress WPF Grid控件中网格视图数据布局中的数据单元格,欢迎下载最新版组件体验!
PNG图像文件格式是广泛使用的图像格式之一。在本指南中,我们演示如何借助Aspose.Imaging for .NET,以编程方式实现在 C# 中将 CMX 转换为 PNG。
面向对象的矢量图形引擎库,支持2D和3D图形,用于可视化其应用程序,无限分发授权。
VectorDraw web library (javascript)基于HTML5的矢量图引擎,100%采用Javascript编写,无客户端插件也可在浏览器中编辑你的矢量图形。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@evget.com
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢
慧都科技 版权所有 Copyright 2003-
2025 渝ICP备12000582号-13 渝公网安备
50010702500608号