arcengine 保存

        /// <summary>
        /// 保存MXD图件
        /// </summary>
        /// <param name="strPath">保存路径</param>
        /// <param name="pMap">地图</param>
        private void saveMxd(string strPath)
        {
            IMapDocument pMapDocument = new MapDocumentClass();
            pMapDocument.New(strPath);

            pMapDocument.ReplaceContents((IMxdContents)axPageLayoutControl1.Object);
            pMapDocument.SetActiveView(axPageLayoutControl1.ActiveView);

            pMapDocument.Save(true, true);
        }

 

        /// <summary>
        /// 保存MXD图件
        /// </summary>
        /// <param name="strPath">保存路径</param>
        /// <param name="pMap">地图</param>
        private void saveMxd(string strPath, IMap pMap)
        {
            IMxdContents pMxdC; pMxdC = pMap as IMxdContents;
            IMapDocument pMapDocument = new MapDocumentClass();
            pMapDocument.New(strPath);
            IActiveView pActiveView = pMap as IActiveView;
            pMapDocument.ReplaceContents(pMxdC);
            pMapDocument.Save(true, true);
        }

 

posted @ 2016-07-29 11:53  恋上微笑的天使  阅读(505)  评论(0编辑  收藏  举报