微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 测试测量 > 虚拟仪器 > Re: 问各位高手关于CNiGraph

Re: 问各位高手关于CNiGraph

时间:12-13 整理:3721RD 点击:
存成emf文件比较简单,
        CFileDialog dlg(FALSE, "emf", "*.emf", OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, ".emf");
        if(dlg.DoModal() == IDOK)
        {
                HDC                             hMetaFileDC;
                CDC                             cdc;
                CRect                   rcGraph;
                CMetaFileDC             mf;
                CPictureHolder  ph;
                VERIFY(mf.CreateEnhanced(NULL, dlg.GetPathName(), NULL, NULL));
                hMetaFileDC = mf.m_hDC;
                cdc.Attach(hMetaFileDC);
                // get the rectangle of the controls in screen coordinates
                m_Graph.GetWindowRect(&rcGraph);
                // convert the coordinates into the coordinates of the dialog window
                ScreenToClient(&rcGraph);
                // Control Image returns a metafile of the control
                ph.SetPictureDispatch((LPPICTUREDISP)m_Graph.ControlImage().GetDispatch(FALSE));
                ph.Render(&cdc, rcGraph, rcGraph);
                HENHMETAFILE handle = mf.CloseEnhanced();
                DeleteEnhMetaFile(handle);
        }              

Tools->Measurement Studio Reference->Visual C++ Help->Tutorials->
Distributing and ...

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top