阅读:2579回复:1
ae导出jpeg图像时的问题:Not enough memory to create requested bitmap
<P>大家好啊,我按照例子中的代码写了一个从mapcontrol导出jpeg图片的函数,具体代码如下</P>
<P>double lScreenResolution;<BR> lScreenResolution = MainaxMapControl.ActiveView.ScreenDisplay.DisplayTransformation.Resolution;</P> <P> ESRI.ArcGIS.Output.IExport pExporter = new ExportJPEGClass() as IExport;<BR> pExporter.ExportFileName = exportJPGDialog.FileName;<BR> pExporter.Resolution = lScreenResolution;</P> <P> tagRECT deviceRECT;<BR> deviceRECT.bottom = 0;<BR> deviceRECT.left = 0;<BR> deviceRECT.right = 0;<BR> deviceRECT.top = 0;<BR> MainaxMapControl.ActiveView.ScreenDisplay.DisplayTransformation.set_DeviceFrame(ref deviceRECT);</P> <P> IEnvelope pDriverBounds = new EnvelopeClass();</P> <P> pDriverBounds.PutCoords(deviceRECT.left, deviceRECT.bottom, deviceRECT.right, deviceRECT.top);</P> <P> pExporter.PixelBounds = pDriverBounds;</P> <P> ITrackCancel pCancel = new CancelTrackerClass();<BR> <FONT color=#ee0000>MainaxMapControl.ActiveView.Output(pExporter.StartExporting(), (int)lScreenResolution, ref deviceRECT, MainaxMapControl.ActiveView.Extent, pCancel);<BR></FONT> pExporter.FinishExporting();<BR> pExporter.Cleanup();</P> <P>但执行到红色这句时总出错:Not enough memory to create requested bitmap.即时我不打开任何文件,空白的mapcontrol也是一样的出错。这是怎么回事啊,代码我对照了很多地方都是基本相同的阿</P> |
|
1楼#
发布于:2007-06-02 22:01
你需要设置一下tagRECT的大小,例如设置为0,0,900,600之类的
|
|