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

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

楼主#
更多 发布于:2007-05-18 20:29

大家好啊,我按照例子中的代码写了一个从mapcontrol导出jpeg图片的函数,具体代码如下

double lScreenResolution;
                   lScreenResolution = MainaxMapControl.ActiveView.ScreenDisplay.DisplayTransformation.Resolution;

                   ESRI.ArcGIS.Output.IExport pExporter = new ExportJPEGClass() as IExport;
                   pExporter.ExportFileName = exportJPGDialog.FileName;
                   pExporter.Resolution = lScreenResolution;

                   tagRECT deviceRECT;
                   deviceRECT.bottom = 0;
                   deviceRECT.left = 0;
                   deviceRECT.right = 0;
                   deviceRECT.top = 0;
                   MainaxMapControl.ActiveView.ScreenDisplay.DisplayTransformation.set_DeviceFrame(ref deviceRECT);

                   IEnvelope pDriverBounds = new EnvelopeClass();

                   pDriverBounds.PutCoords(deviceRECT.left, deviceRECT.bottom, deviceRECT.right, deviceRECT.top);

                   pExporter.PixelBounds = pDriverBounds;

                   ITrackCancel pCancel = new CancelTrackerClass();
                   MainaxMapControl.ActiveView.Output(pExporter.StartExporting(), (int)lScreenResolution, ref deviceRECT, MainaxMapControl.ActiveView.Extent, pCancel);
                   pExporter.FinishExporting();
                   pExporter.Cleanup();

但执行到红色这句时总出错:Not enough memory to create requested bitmap.即时我不打开任何文件,空白的mapcontrol也是一样的出错。这是怎么回事啊,代码我对照了很多地方都是基本相同的阿

喜欢0 评分0
默认头像
路人甲
路人甲
  • 注册日期2007-05-20
  • 发帖数3
  • QQ
  • 铜币119枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2007-06-02 22:01
你需要设置一下tagRECT的大小,例如设置为0,0,900,600之类的
举报 回复(0) 喜欢(0)     评分
默认头像

返回顶部