mdmwolf
路人甲
路人甲
  • 注册日期2006-12-29
  • 发帖数18
  • QQ
  • 铜币257枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1065回复:0

直接打印mapcontrol中的shp地图

楼主#
更多 发布于:2007-06-27 15:04
<P>现在能把Mapcontrol中的shp地图打印了,可为什么打印出的图是如此的小呢  该了参数也没有效果呢 有人遇到过吗</P>
<P>代码如下:</P>
<P>           ITrackCancel pCancel;<BR>            System.Drawing.Printing.PrintDocument sysPrintDocumentDocument;<BR>            double index;<BR>            IPrinter pPrinter;<BR>            IPaper pPaper;<BR>            IActiveView pActiveView;<BR>            double screenResolution;<BR>            tagRECT userRECT;<BR>            IEnvelope pDriverBounds;<BR>            index = axMapControl1.ActiveView.ScreenDisplay.DisplayTransformation.Resolution;</P>
<P>            pPaper = new Paper();<BR>            pPrinter = new EmfPrinterClass();<BR>            sysPrintDocumentDocument = new System.Drawing.Printing.PrintDocument();</P>
<P>            pPaper.PrinterName = sysPrintDocumentDocument.PrinterSettings.PrinterName;<BR>            pPrinter.Paper = pPaper;<BR>            pCancel = new CancelTrackerClass();<BR>            userRECT = axMapControl1.ActiveView.ScreenDisplay.DisplayTransformation.get_DeviceFrame();<BR>            pDriverBounds = new EnvelopeClass();<BR>            pDriverBounds.PutCoords(userRECT.left,userRECT.bottom,userRECT.right,userRECT.top);<BR>            axMapControl1.ActiveView.Output(pPrinter.StartPrinting(pDriverBounds, 0), System.Convert.ToInt16(index), ref userRECT, axMapControl1.ActiveView.Extent, pCancel);<BR>            pPrinter.FinishPrinting();</P>
喜欢0 评分0
游客

返回顶部