arcmap点图层获取tif图像素值,ArcMap中输出tif图片时的Write GeoTIFF Tags选项,Engine中如何实现?...
private bool NewExport(IActiveView activeView, string pathFileName, int pOutDPI)
{
if (activeView == null || !(pathFileName.EndsWith(.tif)))
{
return false;
}
IExport pExport = new ExportTIFFClass(); //創建輸出對象
pExport.ExportFileName = pathFileName; //定義輸出圖片位置
int screenResolution = 96; //屏幕分辨率
int outputResulotion = pOutDPI;
pExport.Resolution = outputResulotion; //定義輸出圖片分辨率
tagRECT exportRECT;
exportRECT.left = 0;
exportRECT.top = 0;
exportRECT.right = activeView.ExportFrame.right * (outputResulotion / screenResolution);
exportRECT.bottom = activeView.ExportFrame.bottom * (outputResulotion / screenResolution); //獲取當前要輸出的區域
// Set up the PixelBounds envelope to match the exportRECT
IEnvelope pExportEnv = new EnvelopeClass();
pExportEnv.PutCoords(exportRECT.left, exportRECT.top, exportRECT.right, exportRECT.bottom);
pExport.PixelBounds = pExportEnv; //設置輸出圖片大小
IExportTIFF exportTiff = pExport as IExportTIFF;
exportTiff.GeoTiff = true;
exportTiff.CompressionType = esriTIFFCompression.esriTIFFCompressionLZW;
IWorldFileSettings worldFileSet = pExport as IWorldFileSettings;
worldFileSet.MapExtent = activeView.Extent;
int hDC = pExport.StartExporting();
activeView.Output(hDC, Convert.ToInt32(outputResulotion), ref exportRECT, null, null); //輸出圖片
pExport.FinishExporting(); //結束輸出
pExport.Cleanup(); //清理臨時文件、釋放內存
return true;
}
總結
以上是生活随笔為你收集整理的arcmap点图层获取tif图像素值,ArcMap中输出tif图片时的Write GeoTIFF Tags选项,Engine中如何实现?...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 画布canvas的使用2
- 下一篇: 语音识别声学模型介绍