【正文】
m_TOCControl = 39。the map contents of the MapControl () 39。Save with the current relative path setting () MsgBox(Changes saved successfully!, , Saved Document) End Sub Developing Applications with ArcGIS Engine Copyright 169。Save changes to the current document Else (sFilePath, True) 39。 2022 ESRI. All rights reserved. 320 IMapDocument: 打開和保存 ?讀取和寫地圖文檔的成員函數(shù) ? Open: 打開已經(jīng)存在的地圖文檔 (mxd, mxt, lyr, pmf) ? SaveAs: 保存當前文檔到新的文件 Public Sub OpenDocument(ByRef sFilePath As String) m_pMapDocument = New MapDocument 39。Portrait orientation = 1 39。 Select the element Dim graphicsContainerSelect As IGraphicsContainerSelect graphicsContainerSelect = (m_element) (esriViewDra, Nothing, Nothing) Private Sub AxPageLayoutControl1_OnAfterDraw(…) Handles If ( = ) Then If (m_element Is Nothing) Then Exit Sub 39。 2022 ESRI. All rights reserved. 316 使用 elements ?關(guān)于 elements有很多高級的成員函數(shù) ? IPageLayoutControl ? AddElement ? FindElementByName ? LocateFrontElement ? GraphicsContainer Private Sub AxPageLayoutControl1_OnMouseDown(ByVal… Dim point As IPoint = New Point (, ) 39。Rightclick Dim rect As IEnvelope rect = = End If End Sub Developing Applications with ArcGIS Engine Copyright 169。500 is the flash interval feature = Loop End Sub Private Sub AxMapControl1_OnMouseDown(…) Handles ‘Zoom to the area of interest using the TrackRectangle If ( = 2) Then 39。Add the city shapefile 39。Suppress drawing while resizing m_mapControl = setstyle(, True) End Sub Protected Overrides Sub OnNotifyMessage(ByVal m As ) If ( = WM_ENTERSIZEMOVE) Then (True, 0) ElseIf ( = WM_EXITSIZEMOVE) Then (False, 0) End If End Sub Developing Applications with ArcGIS Engine Copyright 169。H231 39。Get rotation angle dRotationAngle = = dRotationAngle 39。 2022 ESRI. All rights reserved. 38 制圖控件 : 事件 ? IMapControlEvents/IPageLayoutControlEvents ?OnAfterDraw, OnBeforeScreenDraw, OnAfterScreenDraw, OnExtentUpdated, OnMouseDown/Up/Move, OnKeyDown/Up, OnOleDrop, OnViewRefreshed, OnMap/PageReplaced Private Sub AxMapControl1_OnMouseDown(…) Handles … 39。 2022 ESRI. All rights reserved. 36 PageLayoutControl控件 ? PageLayoutControl ?封裝 PageLayout coclass ?繪制地圖元素 ?創(chuàng)建版面視圖 ?打印 ?設置當前工具 ?加載地圖文檔 ?庫 ? Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 32 課 3 概述 ? ArcGIS Engine 控件 ?控件框架 ?制圖控件和對象 ?框架控件 ?命令和工具 ?管理地圖文檔 Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. Developing Applications with ArcGIS Engine 制圖控件應用開發(fā) Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 35 MapControl控件 ? MapControl ?封裝 Map coclass ?繪制單 Data Frame ?用來分析和瀏覽 ?暴露鼠標和繪制事件 ?裝載地圖文檔和其它文件 ?設置當前工具 ?庫 ? Developing Applications with ArcGIS Engine Copyright 169。Specify which dataframe to display in map Dim maps As IArray maps = (fileName,) Dim map As IMap Dim i as Integer For i = 0 to 1 map = (i) If = Layers Then = map End If Next End Sub Developing Applications with ArcGIS Engine Copyright 169。Draw rotated display End Sub Private Sub AxMapControl1_OnMouseUp(…) Handles Dim dRotationAngle As Double 39。 2022 ESRI. All rights rese