阅读:1188回复:0
[求助]把地图保存为图片出错
<P>' CoMDlg.FileTitle = "把地图保存为图片"<BR> CoMDlg.fileName = ""<BR> CoMDlg.Filter = "JPG图片(*.JPG)|*.jpg"<BR> CoMDlg.ShowSave<BR> If CoMDlg.fileName <> "" Then<BR> Dim lScrRes As Long<BR> lScrRes = Me.MapCtr.ActiveView.ScreenDisplay.displayTransformation.Resolution<BR> <BR> Dim pExporter As IExporter<BR> Set pExporter = New JpegExporter<BR> pExporter.ExportFileName = CoMDlg.fileName<BR> pExporter.Resolution = lScrRes<BR> Dim deviceRECT As tagRECT<BR> deviceRECT = Me.MapCtr.ActiveView.ScreenDisplay.displayTransformation.DeviceFrame<BR> Dim pDriverBounds As IEnvelope<BR> <FONT color=#ff3300>Set pDriverBounds = New Envelope</FONT></P>
<P> pDriverBounds.PutCoords deviceRECT.Left, deviceRECT.Bottom, deviceRECT.Right, deviceRECT.Top<BR> pExporter.PixelBounds = pDriverBounds<BR> Dim pCancel As ITrackCancel<BR> Set pCancel = New CancelTracker<BR> Me.MapCtr.ActiveView.Output pExporter.StartExporting, lScrRes, deviceRECT, Me.MapCtr.ActiveView.Extent, pCancel<BR> pExporter.FinishExporting<BR> End If</P> <P>Set pDriverBounds = New Envelope 这句报错,说无效使用new关键字</P> <P>说明:这段代码由vb.net改正过来的 ,在vb.net里能运行,转到vb就不可以。</P> <P><BR> </P> |
|