保存为栅格图片-MapControl截图——保存ActiveView为jpg图片
2016-09-06 09:15
302 查看
///<summary>Creates a .jpg (JPEG) file from IActiveView. Default values of 96 DPI are used for the image creation.</summary> /// ///<param name="activeView">An IActiveView interface</param> ///<param name="pathFileName">A System.String that the path and filename of the JPEG you want to create. Example: "C:\temp\test.jpg"</param> /// ///<returns>A System.Boolean indicating the success</returns> /// ///<remarks></remarks> public System.Boolean CreateJPEGFromActiveView(ESRI.ArcGIS.Carto.IActiveView activeView, System.String pathFileName) { //parameter check if (activeView == null || !(pathFileName.EndsWith(".jpg"))) { return false; } ESRI.ArcGIS.Output.IExport export = new ESRI.ArcGIS.Output.ExportJPEGClass(); export.ExportFileName = pathFileName; // Microsoft Windows default DPI resolution export.Resolution = 96; ESRI.ArcGIS.Display.tagRECT exportRECT = activeView.ExportFrame; ESRI.ArcGIS.Geometry.IEnvelope envelope = new ESRI.ArcGIS.Geometry.EnvelopeClass(); envelope.PutCoords(exportRECT.left, exportRECT.top, exportRECT.right, exportRECT.bottom); export.PixelBounds = envelope; System.Int32 hDC = export.StartExporting(); activeView.Output(hDC, (System.Int16)export.Resolution, ref exportRECT, null, null); // Finish writing the export file and cleanup any intermediate files export.FinishExporting(); export.Cleanup(); return true; }
源:http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Create_JPEG_from_ActiveView_Snippet/004900000064000000/
相关文章推荐
- Andriod arcgis保存Mapview为图片的实例代码
- QQ截图技巧 保存图片的格式 png与jpg
- andriod arcgis保存Mapview为图片
- VC2005中将Picture控件显示图片保存为BMP,JPG等格式
- 贴几张我们用irrlicht做的游戏截图 jpg图片效果有点差,看起来是不是有点像劲舞团?
- PS处理完图片后为什么保存不了jpg格式?
- JPG,PNG等格式的图片转换的ICON保存为ICO文件
- VB6.0用GDI+保存图片为JPG、TIFF、PNG、GIF、BMP等格式
- VC++ Picture Control中显示jpg图片
- 将charcontrol中的图像截图保存图像
- 保存为BMP,Jpg,Png格式的图片
- 将matlab中用plot绘制的图片保存为任意大小的jpg图片
- 用VB将剪切板中的图片保存为JPG文件
- MySQL保存jpg图片 测试通过
- 截图:截取当前程序的界面,并保存到bmp图片中。
- [AS3]URLLoader+URLRequest+JPGEncoder实现BitmapData图片数据保存
- easyWeb2Pic -- 在IE浏览器中,将整个网页保存为BMP, JPEG/JPG, GIF, PNG或者TIFF图片
- VC++ Picture Control中显示jpg图片
- 保存一个免费的在线的图片转换工具网站,支持BMP,JPG,IOC,PNG和GIF
- 【推荐】免费好用的拷屏工具、截图工具,支持热键、可选区域、可保存为jpg,bmp文件,可复制到剪贴板