翻译|使用教程|编辑:况鱼杰|2019-08-16 11:39:53.840|阅读 218 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常见问题,教程整理的很齐全,非常适合新手学习,本节教程将会介绍如何在Shade / Render / Wire3D模式下正确绘制具有PenWidth的圆。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
相关链接:
VectorDraw Developer Framework(VDF)是一个用于应用程序可视化的图形引擎库。有了VDF提供的功能,您可以轻松地创建、编辑、管理、输出、输入和打印2D和3D图形文件。
VectorDraw Developer Framework试用版下载
问:
在Shade / Render / Wire3D模式下,如何才能正确绘制具有PenWidth的圆?
答:
面对这个问题,我们需要先检查是否可以用OpenGL(这个圆圈的4个边缘)来解决这个圆的笔宽问题,如果发现由于OpenGL限制无法解决这个问题。那么,就建议避免使用带有penwidth的圆/椭圆/弧等对象,而是使用Hatch对象,例如:
vdCircle cir = new vdCircle(); // assume that this is the circle with penwidth inside your block. cir.SetUnRegisterDocument(vdFramedControl1.BaseControl.ActiveDocument); cir.setDocumentDefaults(); cir.Center = new gPoint(3,3); cir.Radius=2; cir.PenWidth = .5; cir.PenColor.SystemColor = Color.Green; vdFramedControl1.BaseControl.ActiveDocument.Model.Entities.AddItem(cir); vdCircle cir1 = new vdCircle(); cir1=cir.Clone(vdFramedControl1.BaseControl.ActiveDocument) as vdCircle; cir1.Radius = cir.Radius - cir.PenWidth / 2.0; vdCircle cir2 = new vdCircle(); cir2 = cir.Clone(vdFramedControl1.BaseControl.ActiveDocument) as vdCircle; cir2.Radius = cir.Radius + cir.PenWidth / 2.0; vdPolyhatch hatch = new vdPolyhatch(); // replace the circle with this object hatch.SetUnRegisterDocument(vdFramedControl1.BaseControl.ActiveDocument); hatch.setDocumentDefaults(); VectorDraw.Professional.vdCollections.vdCurves curs = new VectorDraw.Professional.vdCollections.vdCurves(); curs.AddItem(cir1); curs.AddItem(cir2); hatch.HatchProperties = new vdHatchProperties(VdConstFill.VdFillModeSolid); hatch.HatchProperties.DrawBoundary = false; hatch.HatchProperties.FillColor = cir.PenColor; hatch.PolyCurves.AddItem(curs); vdFramedControl1.BaseControl.ActiveDocument.Model.Entities.AddItem(hatch);
关注慧聚IT微信公众号 ☟☟☟,了解产品的最新动态及最新资讯。
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com
文章转载自:VectorDraw