如何在 ArcObjects 中创建 IDynamicDisplay 对象?

发布于 2024-09-16 07:05:34 字数 85 浏览 6 评论 0原文

我试图在地图上绘制一个文本字形,所有教程都说我需要一个 IDynamicDisplay,但我不知道如何获得它。提前致谢。 ; ) 编辑:C# VS2010

I am trying to draw a text glyph on the map and all the tutorials say I need a IDynamicDisplay, but I don't know how to get at one. Thanks in advance. ; )
edit: C# VS2010

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

彻夜缠绵 2024-09-23 07:05:34

首先,您需要将 Map 对象的 IDynamicMap::DynamicMapEnabled 属性设置为 true。

IDynamicMap pDynamicMap = pMap as IDynamicMap;
pDynamicMap.DynamicMapEnabled = true

那么,有两种方法可以获取DynamicDisplay对象。一种是通过实现 IDynamicLayer 接口创建自定义层。第二个是挂钩 IDynamicMapEvents::BeforeDynamicDraw 事件或 IDynamicMapEvents::AfterDynamicDraw 事件。我希望这个最佳实践对您有所帮助。

使用动态显示的最佳实践

First you need to set IDynamicMap::DynamicMapEnabled property from Map object to true.

IDynamicMap pDynamicMap = pMap as IDynamicMap;
pDynamicMap.DynamicMapEnabled = true

Then, there are two ways to get DynamicDisplay object. One is creating custom Layer with implement IDynamicLayer interface. Second one is hooking IDynamicMapEvents::BeforeDynamicDraw event or IDynamicMapEvents::AfterDynamicDraw event. I hope this best practice help you.

Best practices for using dynamic display

已下线请稍等 2024-09-23 07:05:34

您必须连接一个事件处理程序

ESRI.ArcGIS.Carto.IDynamicMapEvents_Event dynamicMapEvents = dynamicMap as ESRI.ArcGIS.Carto.IDynamicMapEvents_Event;
ESRI.ArcGIS.Carto.IActiveViewEvents_Event avEvents = activeView as ESRI.ArcGIS.Carto.IActiveViewEvents_Event;
avEvents.AfterDraw += new ESRI.ArcGIS.Carto.IActiveViewEvents_AfterDrawEventHandler(avEvents_AfterDraw);
dynamicMapEvents.AfterDynamicDraw += new IDynamicMapEvents_AfterDynamicDrawEventHandler(dynamicMapEvents_AfterDynamicDraw);

You have to wire up an event handler

ESRI.ArcGIS.Carto.IDynamicMapEvents_Event dynamicMapEvents = dynamicMap as ESRI.ArcGIS.Carto.IDynamicMapEvents_Event;
ESRI.ArcGIS.Carto.IActiveViewEvents_Event avEvents = activeView as ESRI.ArcGIS.Carto.IActiveViewEvents_Event;
avEvents.AfterDraw += new ESRI.ArcGIS.Carto.IActiveViewEvents_AfterDrawEventHandler(avEvents_AfterDraw);
dynamicMapEvents.AfterDynamicDraw += new IDynamicMapEvents_AfterDynamicDrawEventHandler(dynamicMapEvents_AfterDynamicDraw);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文