📄 frm_see.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomctl.ocx"
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "Mo20.ocx"
Begin VB.Form frm_see
BorderStyle = 1 'Fixed Single
Caption = "鸟瞰视图"
ClientHeight = 5340
ClientLeft = 45
ClientTop = 435
ClientWidth = 6870
Icon = "frm_see.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5340
ScaleWidth = 6870
StartUpPosition = 3 '窗口缺省
Begin MSComctlLib.ImageList ImageList1
Left = 4680
Top = 720
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm_see.frx":0442
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm_see.frx":0554
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm_see.frx":0666
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm_see.frx":0778
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm_see.frx":088A
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 420
Left = 0
TabIndex = 1
Top = 0
Width = 6870
_ExtentX = 12118
_ExtentY = 741
ButtonWidth = 609
ButtonHeight = 582
Appearance = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 4
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 4
Object.Width = 2400
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "移动"
ImageIndex = 1
Style = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "矩形选择"
ImageIndex = 5
Style = 2
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "全局"
ImageIndex = 3
Style = 2
EndProperty
EndProperty
End
Begin MapObjects2.Map Map1
Height = 4575
Left = 0
TabIndex = 0
Top = 600
Width = 6495
_Version = 131072
_ExtentX = 11456
_ExtentY = 8070
_StockProps = 225
BackColor = 16777215
BorderStyle = 1
Contents = "frm_see.frx":099C
End
End
Attribute VB_Name = "frm_see"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Boll As Boolean
Dim g_feedback As DragFeedback
Private Sub Form_Activate()
Dim lyr As MapLayer
Dim i As Integer
Map1.Layers.Clear
For i = frm_main.Map1.Layers.Count To 1 Step -1
Set lyr = New MapLayer
Set lyr = frm_main.Map1.Layers.Item(i - 1)
Map1.Layers.Add lyr
Next
Map1.Extent = Map1.FullExtent
End Sub
Private Sub Form_Load()
Boll = False
Map1.Left = 0
Map1.Width = frm_see.Width
Map1.Top = Toolbar1.Height
Map1.Height = frm_see.Height - Toolbar1.Height
'Unload frm_lyr
'Unload frm_Identify
'存在窗体自动关闭的错误
End Sub
Private Sub Map1_AfterLayerDraw(ByVal index As Integer, ByVal canceled As Boolean, ByVal hdc As stdole.OLE_HANDLE)
Dim sym As New Symbol
sym.OutlineColor = moRed
sym.Size = 1
sym.Style = moTransparentFill
If Not Boll Then
Map1.DrawShape frm_main.Map1.Extent, sym
Else
Map1.DrawShape Map1.FullExtent, sym
End If
Boll = False
If index = 0 Then
frm_main.Map1.TrackingLayer.Refresh True
End If
End Sub
Private Sub Map1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim pt As Point
Set pt = Map1.ToMapPoint(x, y)
If Map1.MousePointer = moZoom Then
frm_main.Map1.Extent = Map1.TrackRectangle
End If
If Map1.MousePointer = moCross Then
If frm_main.Map1.Extent.IsPointIn(pt) Then
Set g_feedback = New DragFeedback
g_feedback.DragStart frm_main.Map1.Extent, Map1, x, y
End If
End If
Map1.Refresh
End Sub
Private Sub Map1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If Map1.MousePointer = moCross Then
If Not g_feedback Is Nothing Then
g_feedback.DragMove x, y
End If
End If
End Sub
Private Sub Map1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If Map1.MousePointer = moCross Then
If Not g_feedback Is Nothing Then
frm_main.Map1.Extent = g_feedback.DragFinish(x, y)
Set g_feedback = Nothing
End If
End If
Map1.Refresh
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
If Toolbar1.Buttons(3).Value Then
Map1.MousePointer = moZoom
End If
If Toolbar1.Buttons(2).Value Then
Map1.MousePointer = moCross
End If
If Toolbar1.Buttons(4).Value Then
frm_main.Map1.Extent = frm_main.Map1.FullExtent
Map1.MousePointer = moArrow
Map1.Extent = Map1.FullExtent
Boll = True
Map1.Refresh
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -