diligentpig
路人甲
路人甲
  • 注册日期2005-09-14
  • 发帖数47
  • QQ
  • 铜币277枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2437回复:1

ae导出jpeg图像时的问题:Not enough memory to create requested bitmap

楼主#
更多 发布于:2007-05-18 20:29
<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>
喜欢0 评分0
iwill
路人甲
路人甲
  • 注册日期2007-05-20
  • 发帖数3
  • QQ
  • 铜币119枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2007-06-02 22:01
你需要设置一下tagRECT的大小,例如设置为0,0,900,600之类的
举报 回复(0) 喜欢(0)     评分
游客

返回顶部