翻譯|使用教程|編輯:況魚杰|2019-08-15 13:57:04.140|閱讀 312 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常見問題,教程整理的很齊全,非常適合新手學(xué)習(xí),本節(jié)教程將會(huì)介紹如何實(shí)現(xiàn)混合渲染模式。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
VectorDraw Developer Framework(VDF)是一個(gè)用于應(yīng)用程序可視化的圖形引擎庫(kù)。有了VDF提供的功能,您可以輕松地創(chuàng)建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。
VectorDraw Developer Framework試用版下載
問:
如何才能在繪制數(shù)字時(shí)混合渲染模式?能否有代碼示例實(shí)現(xiàn)如下目標(biāo):
使用Wire3D渲染繪制vdPolyface。
使用Shade / Hide / ShadeOn / Render模式渲染繪制所有其他圖形。
答:
想要實(shí)現(xiàn)目標(biāo)可以采用以下代碼:
private void Form1_Load(object sender, EventArgs e) { vdFramedControl1.BaseControl.ActiveDocument.New(); if (vdFramedControl1.BaseControl.ActiveDocument.CommandAction.CmdSphere(new gPoint(0, 0, 0), 3.0d, 6, 6)) { vdFramedControl1.BaseControl.ActiveDocument.Model.Entities[vdFramedControl1.BaseControl.ActiveDocument.Model.Entities.Count - 1].Label = "WIRE3D"; // the sphere will be drawn as Wire3D } vdFramedControl1.BaseControl.ActiveDocument.CommandAction.CmdBox3d(new gPoint(5, 0, 0), 3.0d, 4.0d, 2.0d, 0.0d); vdFramedControl1.BaseControl.ActiveDocument.ZoomExtents(); vdFramedControl1.BaseControl.ActiveDocument.FreezeEntityDrawEvents.Push(false); vdFramedControl1.BaseControl.ActiveDocument.GlobalRenderProperties.CustomRenderTypeName = "VectorDraw.Render.opengllist#VectorDraw.Professional.dll"; vdFramedControl1.BaseControl.ActiveDocument.OnDrawFigure += new vdDocument.FigureDrawEventHandler(ActiveDocument_OnDrawFigure); } void ActiveDocument_OnDrawFigure(object sender, VectorDraw.Render.vdRender render, ref bool cancel) { vdPolyface pface = sender as vdPolyface; if (pface != null) { if (pface.Label == "WIRE3D")// You can check here by Label/XProperty/Handle/Type/Layer etc { vdFramedControl1.BaseControl.ActiveDocument.FreezeEntityDrawEvents.Push(true); VectorDraw.Render.vdRender.Mode RMode = render.RenderMode; render.RenderMode = VectorDraw.Render.vdRender.Mode.Wire3d; pface.Draw(render); render.RenderMode = RMode; cancel = true; vdFramedControl1.BaseControl.ActiveDocument.FreezeEntityDrawEvents.Pop(); } } }
關(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)載自: