?? 5 添加文本.txt
字號(hào):
'添加文本
Private Sub Hello()
Dim pDoc As IMxDocument '地圖文檔
Dim pActiveView As IActiveView '活動(dòng)地圖
Dim sym As ITextSymbol '文本符號(hào)
Dim bnds As IArea '面
Set pDoc = Application.Document '獲取當(dāng)前地圖文檔
Set pActiveView = pDoc.activeView '獲取當(dāng)前活動(dòng)地圖
Set sym = New TextSymbol '創(chuàng)建文本符號(hào)
sym.Font.size = 18 '設(shè)置字體大小
With pActiveView.ScreenDisplay '對(duì)顯示屏操作
Set bnds = .DisplayTransformation.VisibleBounds '獲取可視范圍
.StartDrawing .hDC, esriNoScreenCache
.SetSymbol sym '設(shè)置要繪制的符號(hào)
.DrawText bnds.Centroid, "Hello" '添加文本
.FinishDrawing '完成繪制
End With
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -