首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >参考arcgis

参考arcgis
EN

Stack Overflow用户
提问于 2013-10-23 10:09:06
回答 1查看 814关注 0票数 1

我从http://forums.arcgis.com/threads/30635-How-to-Select-Feature-by-XY-Location-and-Highlight-it-in-ArcMap-9.3-programmatically网站借用了这个代码

它涉及到放大到一个任命。但我不知道如何实现这一点。或者我需要或使用的一些参考资料。

因为我是arcgis和c#的新手。如果有人有更多的经验可以帮助我,这将是非常感谢。

代码语言:javascript
复制
public static void CaptureMapCoordinates(int x, int y)
    {
        // get the map coordinates from the screen coordinates
        IPoint pScreenPoint = new ESRI.ArcGIS.Geometry.Point();
        IPoint pMapPoint = new ESRI.ArcGIS.Geometry.Point();
        IEnvelope pEnv = new EnvelopeClass();

        pScreenPoint.X = x;
        pScreenPoint.Y = y;

        pMapPoint = GetMapCoordinatesFromScreenCoordinates(pScreenPoint, pActiveView);

        pEnv = pActiveView.Extent;
        pEnv.CenterAt(pMapPoint);

        pActiveView.Extent = pEnv;
        pActiveView.Refresh();

    }

    private static IPoint GetMapCoordinatesFromScreenCoordinates(IPoint pScreenPoint, IActiveView pActiveView)
    {
        IScreenDisplay pScreenDisplay;
        IDisplayTransformation pDisplayTransformation;

        if (pScreenPoint == null || pScreenPoint.IsEmpty || pActiveView == null)
        {
            return null;
        }

        pScreenDisplay = pActiveView.ScreenDisplay;
        pDisplayTransformation = pScreenDisplay.DisplayTransformation;

        return pDisplayTransformation.ToMapPoint((int)pScreenPoint.X, (int)pScreenPoint.Y);
    }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-23 13:43:14

我从你的评论,你希望为ArcMap添加,而不是一个独立的WPF应用程序。我相信这个链接会让你开始。这是一个循序渐进的过程,用于为ArcMap创建加载项。

ins/0001000001ms000000/

开发需要Visual。

如果这件事对你有帮助的话,请把它标记为答案。谢谢

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19538759

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档