翻譯|使用教程|編輯:況魚杰|2019-08-16 11:39:53.840|閱讀 275 次
概述:本系列教程整理了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@fc6vip.cn
文章轉載自: