|
阅读:1064回复:0
直接打印mapcontrol中的shp地图
<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> |
|