欢迎来到天天文库
浏览记录
ID:6806980
大小:226.00 KB
页数:61页
时间:2018-01-26
《地图和图层的管理设计》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、地图文档管理PageLayout地图管理图层管理Render一、地图文档管理——LXMXDDocumentClass接口IMapDocmentIMapControl3IPageLayoutControl2功能:新建、打开、保存、另存、设置保存路径(相对还是绝对路径)、新建publicboolCreateMapDocument(stringmxdPath)方法功能:新建地图文档输入参数:stringmxdPath地图文档的保存路径返回参数:bool值为True时,表示新建成功;值为False表示建立失败打开publicboolOpenMap(stringstrPath,boolbPage
2、Layout)方法功能:在MapControl或PageLayout中打开给定的图文件输入参数:stringstrMXDPath打开的地图文档路径及文件名boolbPageLayout是否用PageLayout打开地图返回参数:bool值为True时,表示打开成功;值为False表示打开失败保存publicboolSaveMapDocument(stringpSMxdFile,stringpTMxdFile)方法功能保存MXD文件输入参数stringpSMxdFile源MXD文件名stringpTMxdFile目标MXD文件名注意pSMxdFile与pTMxdFile相等返回参数:bo
3、ol值为True时,表示保存成功;值为False表示保存失败另存publicboolSaveAsMapDocument(stringpSMxdFile,stringpTMxdFile)方法功能保存MXD文件输入参数stringpSMxdFile源MXD文件名stringpTMxdFile目标MXD文件名注意pSMxdFile与pTMxdFile不相等返回参数:bool值为True时,表示保存成功;值为False表示保存失败设置保存路径publicboolSetDSavePath(stringdSavePath)方法功能:设置文档保存路径注意是相对还是绝对(还是有点疑问,是否要放在系统配
4、置中)输入参数:stringdSavePath文档保存路径返回参数:bool值为True表示设置成功;值为False表示设置失败'地图文档打印PrivateFunctionMapPrint()OnErrorGoToErrorHandlerIfPageLayoutCtrl.PrinterIsNothingThenMsgBox"没有打印机",,"提示"ExitFunctionEndIfDimpPrinterAsIPrinterSetpPrinter=PageLayoutCtrl.PrinterIfpPrinter.Paper.Orientation<>PageLayoutCtrl.Page
5、.OrientationThenpPrinter.Paper.Orientation=PageLayoutCtrl.Page.OrientationEndIfDimdWidthAsDouble,dHeightAsDoublepPrinter.QueryPaperSizedWidth,dHeightPageLayoutCtrl.PrintPageLayout'打印PageLayoutCtrl.MousePointer=esriPointerDefaultExitFunctionErrorHandler:ErrorOperateErr.Description,Erl,c_sModuleFi
6、leName,"MapPrintSetting"EndFunction'地图文档打印设置PrivateFunctionMapPrintSetting()OnErrorGoToErrorHandlerIfNotShowPrinterSetThenExitFunction'如果取消就退出IfPageLayoutCtrl.PrinterIsNothingThenMsgBox"没有打印机",,"提示"ExitFunctionEndIfDimdWidthAsDouble,dHeightAsDouble,iUnitsAsIntegerDimpPrinterAsIPrinterSetpPrinter
7、=PageLayoutCtrl.PrinterpPrinter.Paper.FormID=Printer.PaperSizepPrinter.Paper.Orientation=Printer.OrientationdWidth=pPrinter.Paper.PrintableBounds.Envelope.WidthdHeight=pPrinter.Paper.PrintableBounds.Envelope.HeightWithPageLa
此文档下载收益归作者所有