////// 保存MXD图件 /// /// 保存路径 /// 地图 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); }
////// 保存MXD图件 /// /// 保存路径 /// 地图 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); }