/// <summary>
/// 像素值与经纬度值的换算
/// </summary>
/// <param name="activeView"></param>
/// <param name="iDevUnit"></param>
/// <returns></returns>
public double calcMapScale(IActiveView activeView, double iDevUnit) //后面参数为像素值
{
double mapUnits = 0.01;
IScreenDisplay pSd = activeView.ScreenDisplay;
if (pSd != null)
{
//获取地图空间的像素宽度
IDisplayTransformation pDtf = pSd.DisplayTransformation;
tagRECT tagRect = pDtf.get_DeviceFrame();
int iPixelWid = tagRect.right - tagRect.left;
//获取当前地图视图的地理宽度
IEnvelope pExtentEnve = activeView.Extent;
mapUnits = pExtentEnve.Width / iPixelWid * iDevUnit;
}
return mapUnits;
}
屏幕像素值与经纬度值的换算
最新推荐文章于 2024-07-20 03:47:39 发布