翻譯|使用教程|編輯:況魚杰|2019-11-01 10:34:09.637|閱讀 226 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常見問題,教程整理的很齊全,非常適合新手學習。本文將會展示?有可能來忽略節剪輯的類似vdInsert這樣的對象。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
VectorDraw Developer Framework(VDF)是一個用于應用程序可視化的圖形引擎庫。有了VDF提供的功能,您可以輕松地創建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。
VectorDraw Developer Framework試用版下載
問:
是否有可能使用像vdInsert這樣的對象來忽略節剪輯?我希望圖形上的所有其他對象都可以通過部分剪切來剪切,但不希望通過此vdInsert來剪切。我怎樣才能做到這一點?
答:
您可以使用vdRender對象和ClearAllSectionClips / ApplySectionClips方法來執行此操作,請參見下面的代碼:
vdInsert clip_ins = null; // will be used to check the object that will not have section clips applied for it ISectionClips sectionclips = null; // will be used to restore the section clips later private void button10_Click(object sender, EventArgs e) { vdDocument doc = vdFramedControl1.BaseControl.ActiveDocument; doc.Open(@"C:\test\SEC_clip.vdml");// use your path here to open a test drawing that contains the vdInsert and section clips doc.CommandAction.Zoom("W", new gPoint(-2,-2), new gPoint(30,30)); clip_ins = doc.Model.Entities[1] as vdInsert; // this is the vdInsert that will ignore section clipping if (clip_ins == null) return; // this is the vdInsert that defines the section clipping ! doc.FreezeEntityDrawEvents.Push(false); doc.FreezeModifyEvents.Push(false); doc.OnDrawFigure += new vdDocument.FigureDrawEventHandler(doc_OnDrawFigure); // these two events are necessary doc.OnDrawAfterFigure += new vdDocument.FigureAfterDrawEventHandler(doc_OnDrawAfterFigure); } void doc_OnDrawAfterFigure(object sender, VectorDraw.Render.vdRender render) { if (sender != null && sender == clip_ins) // re-enable section clips for this vdInsert { render.ApplySectionClips(sectionclips); // using the stored section clips from DrawFigure event } } void doc_OnDrawFigure(object sender, VectorDraw.Render.vdRender render, ref bool cancel) { if (sender != null && sender == clip_ins)// disable section clips for this vdInsert { sectionclips = render.SectionClips; // keep the section clips for the DrawAfterFigure to be re-enabled render.ClearAllSectionClips(); // and clear them } }//end
對于以上問答,如果您有任何的疑惑都可以在評論區留言,我們會及時回復。此系列的問答教程我們會持續更新,如果您感興趣,可以多多關注本教程。
熱門文章推薦:
如果您對想要購買正版授權VectorDraw Developer Framework(VDF),可以聯系咨詢相關問題。
關注慧聚IT微信公眾號 ???,了解產品的最新動態及最新資訊。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自: