ラスターの解像度にズーム

 2016/9/1 (木)    

//マップ単位をインチに設定
IMap pMap = axMapControl1.Map;
pMap.MapUnits = ESRI.ArcGIS.esriSystem.esriUnits.esriInches;
 
/ラスタレイヤの取得
IActiveView pActiveView = axMapControl1.ActiveView;
IRasterLayer pRasterLayer = (IRasterLayer)pMap.get_Layer(0);
 
/ラスタのセルサイズを取得
IRaster pRaster = pRasterLayer.Raster;
IRasterProps pRasterProps = (IRasterProps)pRaster;
double dblCellsize = pRasterProps.MeanCellSize().X;
 
ンの解像度を取得
IDisplayTransformation pDiplayTransformation = pActiveView.ScreenDisplay.Displayrmation;
double dblDPI = pDiplayTransformation.Resolution;
       
/縮尺の計算とリフレッシュ
pMap.MapScale = dblDPI * dblCellsize;
pActiveView.Refresh()
       
pMap.MapUnits = ESRI.ArcGIS.esriSystem.esriUnits.esriUnknownUnits;

Copyright© WINGFIELD since1981 , 2018 All Rights Reserved.