📄 frmlandblxydemo.frm
字号:
VERSION 5.00
Begin VB.Form frmLandBLXYDemo
BorderStyle = 3 'Fixed Dialog
Caption = "Demo"
ClientHeight = 7050
ClientLeft = 45
ClientTop = 435
ClientWidth = 6285
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7050
ScaleWidth = 6285
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command2
Caption = "演示"
Height = 555
Left = 4020
TabIndex = 9
Top = 990
Width = 1845
End
Begin VB.ListBox List1
Height = 4350
Left = 450
TabIndex = 4
Top = 2160
Width = 3405
End
Begin VB.Frame Frame1
Caption = "已知数据"
Height = 1845
Left = 420
TabIndex = 1
Top = 240
Width = 3435
Begin VB.TextBox txtLo
Height = 375
Left = 1230
TabIndex = 5
Text = "117"
Top = 1200
Width = 1845
End
Begin VB.TextBox txtX
Height = 315
Left = 1050
TabIndex = 3
Text = "38"
Top = 390
Width = 2025
End
Begin VB.TextBox txtY
Height = 315
Left = 1080
TabIndex = 2
Text = "117.3029"
Top = 780
Width = 1995
End
Begin VB.Label Label3
Caption = "中央子午线"
Height = 285
Left = 210
TabIndex = 8
Top = 1260
Width = 1005
End
Begin VB.Label Label2
Caption = "经度"
Height = 285
Left = 210
TabIndex = 7
Top = 780
Width = 795
End
Begin VB.Label Label1
Caption = "纬度"
Height = 345
Left = 240
TabIndex = 6
Top = 390
Width = 585
End
End
Begin VB.CommandButton Command1
Caption = "坐标转换"
Height = 555
Left = 4020
TabIndex = 0
Top = 360
Width = 1845
End
End
Attribute VB_Name = "frmLandBLXYDemo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim pMainObj As New xyBLHXYZ
Dim pObj As New xyBLXY80
' Dim pObj As New xyBLXY80
' Dim pObj As New xyBLXY84
Dim x As Double, y As Double, z As Double, B As Double, L As Double, H As Double
Dim OutX As Double, OutY As Double, OutZ As Double
Dim OutB As Double, OutL As Double, OutH As Double
'由经纬度转换至大地坐标
Call pObj.BLXY(txtX, txtY, Val(txtLo), x, y)
List1.AddItem "由经纬度转换至大地坐标"
List1.AddItem x
List1.AddItem y
'北京坐标系由大地坐反算至经纬度
Call pObj.XYBL(x, y, Val(txtLo), OutB, OutL)
List1.AddItem "由大地坐反算至经纬度"
List1.AddItem OutB
List1.AddItem OutL
'由经纬度转换至大地坐标
Call pObj.BLXY(OutB, OutL, Val(txtLo), x, y)
List1.AddItem "由经纬度转换至大地坐标"
List1.AddItem x
List1.AddItem y
'1980坐标系参数
pMainObj.SetCoordinate 6378140, 298.257
'由经纬度转换至大地坐标
Call pMainObj.BLXY(txtX, txtY, Val(txtLo), x, y)
List1.AddItem "由经纬度转换至大地坐标"
List1.AddItem x
List1.AddItem y
'北京坐标系由大地坐反算至经纬度
Call pObj.XYBL(x, y, Val(txtLo), OutB, OutL)
List1.AddItem "由大地坐反算至经纬度"
List1.AddItem pMainObj.StrDMS(OutB)
List1.AddItem pMainObj.StrDMS(OutL)
End Sub
Private Sub Command2_Click()
Dim pMainObj As New xyBLHXYZ
pMainObj.demo
End Sub
Private Sub Form_Load()
Dim aa As New xyBLXY80
Dim x As Double, y As Double, B As Double, L As Double
Dim x1 As Double, y1 As Double, z As Double, H As Double
Dim pPoint As Variant
pPoint = aa.BLXY(38, 117, 117, x, y)
'x = pPoint(0)
'y = pPoint(1)
''pPoint = aa.XYBL(x, y, 117, B, L)
Debug.Print pPoint(0)
Debug.Print pPoint(1)
pPoint = aa.XYHD(x, y, 117, 120, x1, y1)
'x1 = pPoint(1)
'y1 = pPoint(2)
pPoint = aa.XYHD(x1, y1, 120, 117, B, L)
'x = pPoint(1)
'y = pPoint(2)
Debug.Print B
Debug.Print L
Dim bb As New LandBLXY.xyBLHXYZ
pPoint = bb.BLHXYZ(38, 117, 50, x, y, z)
pPoint = bb.XYZBLH(x, y, z, B, L, H)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -