symbolizingelementsandlayers(i)内容摘要:

s reserved. 1220 Lesson overview  Tool 工具的事件 使用 IDisplayTransformation转换屏幕坐标到地图坐标 使用 IGraphicsContainer来管理图形元素 怎么刷新显示 Introduction to Programming ArcObjects with VBA Copyright 169。 2020, 2020 ESRI. All rights reserved. 1221 Tool 工具事件  Tools 工具拥有一些事件过程 用于用户交互的事件 Mouse events: MouseUp, MouseMove, MouseDown, DblClick Keyboard events: KeyUp, KeyDown 用于定义工具行为的事件 Enabled CursorID ToolTip Message BuiltIn Cursors Introduction to Programming ArcObjects with VBA Copyright 169。 2020, 2020 ESRI. All rights reserved. 1222 怎么在事件中使用 X和 Y 相关的鼠标事件 MouseUp, MouseDown, MouseMove 返回的是屏幕单位 (pixels) Private Sub UIToolControl1_MouseDown(ByVal button As Long, _ ByVal shift As Long, ByVal x As Long, ByVal y As Long) MsgBox X = amp。 x MsgBox Y = amp。 y End Sub Introduction to Programming ArcObjects with VBA Copyright 169。 2020, 2020 ESRI. All rights reserved. 1223 Display transformation 在地图单位和屏幕单位之间转换所用到的方法 ToMapPoint: 转换一个屏幕坐标点 (pixels)到一个地图坐标点 FromMapPoint: 转换一个地图坐标点到屏幕坐标点 使用鼠标输入 捕获鼠标点击的象素值 使用地图点 Introduction to Programming ArcObjects with VBA Copyright 169。 2020, 2020 ESRI. All rights reserved. 1224 转换屏幕坐标系到地图单位 使用 IDisplayTransformation的 ToMapPoint方法 返回一个地图单位的点 Dim pMxApp As IMxApplication Set pMxApp = Application Dim pPnt As IPoint Set pPnt = (x, y) MsgBox Longitude = amp。 MsgBox Latitude = amp。 Introduction to Programming ArcObjects with VBA Copyright 169。 2020, 2020 ESRI. All rights reserved. 1225 Example: Rubberbanding 在模块层定义变量 在 tool’s Select 事件中初始化 在 tool’s MouseDown 事件中输入以下代码 把返回值保存在一个对象中 Private m_pRubberBand As IRubberBand Set m_pRubberBand = New RubberLine 39。 or RubberPolygon or RubberEnvelope Dim pLine As IPolyline Dim pSymbol As ISymbol Set pSymbol = New SimpleLineSymbol Dim pMxApp As IMxApplication Set pMxApp = Application Dim pDisplay As IScreenDisplay Set pDisplay = Set pLine = (pDisplay, pSymbol) Introduction to Programming ArcObjects with VBA Copyright 169。 2020, 2020 ESRI. All rights reserved. 1226 IGraphicsContainer对象 有 Map 和 PageLayout支持 也可以使用 IActiveView 的 GraphicsContainer属性来获得 Pa geLa y outMxDocume ntMap*I Graphic s C ont ainerI Graphic s C ont ainer用来修改图形元素的显示顺序 BringToFront, BringForward SendToBack, SendBackward PutElementOrder 用来管理图形元素 AddElement, AddElements,  DeleteElement, DeleteAllElements Introduction to Programming ArcObjects with VBA Copyright 169。 2020, 2020 ESRI. All rights reserved. 1227 管理图形元素 39。 Remove all elements from the Map –or Layout Set pMxDoc = ThisDocument 39。 Add an element to the Layout Set pMxDoc = ThisDocument Dim pGC As IGraphicsContainer Set pGC = pElemArea, 0 39。 Send selected graphics to the back on Layout Dim pGCSelect As IGraphicsContainerSelect Set pGCSelect = pGC „QI Introduction to Programming ArcObjects with VBA Copyright 169。 2020, 2020 ESRI. All rights reserved. 1228 如何刷新显示 使用 IActiveView的 Refresh方法 刷新所有的显示 (但是不刷新 TOC表 ) 使用 IScreenDisplay的 Invalidate的方法 只刷新指定的范围 (envelope) 使用 IMxDocument的 UpdateContents方法 通报该文档对象包含的内容发生了变化 刷行了内容表对象( TOC) Introduction to Programming ArcObjects with VBA Copyright 169。 2020, 2020 ESRI. All rights reserved. 1229 部分刷新显示 也许你只需要刷新部分的显示区域 被新图形元素覆盖的区域 比直接刷新整个文档的效率高 使用 IActiveView的 PartialRefresh方法 用于 Layout 视图或者 Data view 指定什么需要刷新 (., graphics) 指定哪里需要刷新 (an envelope) Copyright 169。 2020, 2020 ESRI. All rights reserved. Introduction to Programming ArcObjects with VBA Data management(III)。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。