zoukankan      html  css  js  c++  java
  • 如何将像素坐标转为地图坐标(转载)

    public System.Double ConvertPixelsToMapUnits(ESRI.ArcGIS.Carto.IActiveView activeView, System.Int32 pixelUnits)
    {
     
      if(activeView == null)
      {
        return -1;
      }
      //Get the ScreenDisplay
      ESRI.ArcGIS.Display.IScreenDisplay screenDisplay = activeView.ScreenDisplay;

      //Get the DisplayTransformation
      ESRI.ArcGIS.Display.IDisplayTransformation displayTransformation = screenDisplay.DisplayTransformation;

      //Get the device frame which will give us the number of pixels in the X direction
      ESRI.ArcGIS.Display.tagRECT deviceRECT = displayTransformation.get_DeviceFrame();
      System.Int32 pixelExtent = (deviceRECT.right - deviceRECT.left);

      //Get the map extent of the currently visible area
      ESRI.ArcGIS.Geometry.IEnvelope envelope = displayTransformation.VisibleBounds;
      System.Double realWorldDisplayExtent = envelope.Width;

      //Calculate the size of one pixel
      if(pixelExtent == 0)
      {
        return -1;
      }
      System.Double sizeOfOnePixel = (realWorldDisplayExtent / pixelExtent);

      //Multiply this by the input argument to get the result
      return (pixelUnits * sizeOfOnePixel);
    }

    转载自:ms-help://MS.VSCC.v90/MS.VSIPCC.v90/ESRI.EDNv9.3/Snippets/html/cabbae3d-ccaf-40cb-9bb6-b4fc44fb125e.htm


     

  • 相关阅读:
    c++ 反汇编 堆变量
    glibc源码逆向——fread函数
    glibc源码逆向——fopen
    buu查漏补缺刷题(3)
    gyctf_2020_borrowstack
    实现用句柄表反调试
    pwnable_orw 学习shellcraft新花样
    buu查漏补缺刷题(2)
    gdb调试源码
    buu查漏补缺刷题(1)
  • 原文地址:https://www.cnblogs.com/wuhenke/p/2055208.html
Copyright © 2011-2022 走看看