• <menu id="w2i4a"></menu>
  • logo VectorDraw Developer Framework使用教程

    文檔首頁>>VectorDraw Developer Framework使用教程>>VDF常見問題整理(五十七):如何多種突出顯示顏色

    VDF常見問題整理(五十七):如何多種突出顯示顏色


    VectorDraw Developer Framework(VDF)是一個(gè)用于應(yīng)用程序可視化的圖形引擎庫。有了VDF提供的功能,您可以輕松地創(chuàng)建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。該庫還支持許多矢量和柵格輸入和輸出格式,包括本地PDF和SVG導(dǎo)出。

    點(diǎn)擊下載VectorDraw Developer Framework


    問:我可以有多種突出顯示顏色嗎?我想突出顯示選中的對(duì)象。我想為選擇集的第一個(gè)對(duì)象設(shè)置不同的突出顯示顏色。

    答:這只能在OnDrawFigure事件中完成,在該事件中,您可以檢查所選對(duì)象是否在臨時(shí)選擇中,在這種情況下,請(qǐng)使用其他顏色繪制該對(duì)象,例如:

    private void button1_Click(object sender, EventArgs e)
    {
        vdDocument doc = vdFramed1.BaseControl.ActiveDocument;
        doc.FreezeEntityDrawEvents.Push(false); //Enable draw events
        doc.OnDrawFigure+=new vdDocument.FigureDrawEventHandler(doc_OnDrawFigure); //add the event andler
    }
    void doc_OnDrawFigure(object sender, VectorDraw.Render.vdRender render, ref bool cancel)
    {
        if (sender == null) return;
        vdDocument doc = vdFramed1.BaseControl.ActiveDocument;
        vdSelection selected = doc.Selections.FindName("VDRAW_TEMPORARY_SELSET"); // get the selection that contains the items
        if (selected == null || selected.Count < 1) return; vdFigure fig = sender as vdFigure; if (fig==null) return; if (selected.FindItem(fig)) // if the fig is in this selection (is selected) { double pix_size = render.PixelSize; if (ReferenceEquals(fig, selected[0])) { // push a different color to the render if this object is the first selected render.PushPenstyle(Color.Red, 4*pix_size); } else { render.PushPenstyle(Color.Yellow, 1*pix_size); } doc.FreezeEntityDrawEvents.Push(true); // disable the event as fig.Draw() will make it fire again fig.Draw(render); // draw the object with the penstyle pushed before doc.FreezeEntityDrawEvents.Pop(); // pop the event..... ALL PUSH must be followed by POP render.PopPenstyle(); //pop the penstyle ..... ALL PUSH must be followed by POP cancel = true; // do not allow vdraw to draw this item it is already draw by fig.Draw() above } else cancel = false; }
    以上問答,如果您有任何的疑惑都可以在評(píng)論區(qū)留言,我們會(huì)及時(shí)回復(fù)。此系列的問答教程我們會(huì)持續(xù)更新,如果您感興趣,可以多多關(guān)注本教程。

    熱門文章推薦:

    =======================================================

    如果您對(duì)想要購買正版授權(quán)VectorDraw Developer Framework(VDF),可以聯(lián)系在線客服>>咨詢相關(guān)問題。

    掃碼咨詢


    添加微信 立即咨詢

    電話咨詢

    客服熱線
    023-68661681

    TOP
    三级成人熟女影院,欧美午夜成人精品视频,亚洲国产成人乱色在线观看,色中色成人论坛 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();