7,763
社区成员
发帖
与我相关
我的任务
分享
Private Sub Command1_Click()
Dim a As String
Dim x As Double
Dim y As Double
Open "E:\vbt\sps\2.s" For Input As #1
Do While Not EOF(1)
Line Input #1, a
x = Mid(a, 48, 8)
y = Mid(a, 57, 10)
Picture1.Scale (784010, 3360000)-(798182, 3369120)
Picture1.DrawWidth = 5
Picture1.PSet (x, y), vbRed
Loop
Close #1
End Sub
Option Explicit
Private Sub Command1_Click()
Dim a As String
Dim x As Double
Dim y As Double
Dim xMax#, xMin#, yMax#, yMin#
Open "E:\vbt\sps\2.s" For Input As #1
xMax = -9E+300:
xMin = -xMax
yMax = xMax
yMin = xMin
Do While Not EOF(1)
Line Input #1, a
x = Mid$(a, 48, 8)
y = Mid$(a, 57, 10)
If (x > xMax) Then xMax = x
If (x < xMin) Then xMin = x
If (y > yMax) Then yMax = y
If (y < yMin) Then yMin = y
Loop
x = (xMax - xMin) * 0.05
y = (yMax - yMin) * 0.05
xMax = xMax + x: xMin = xMin - x
yMax = yMax + y: yMin = yMin - y
Picture1.Scale (xMin, yMax)-(xMax, yMin)
Picture1.DrawWidth = 5
Seek #1, 1
Do While Not EOF(1)
Line Input #1, a
x = Mid(a, 48, 8)
y = Mid(a, 57, 10)
Picture1.PSet (x, y), vbRed
Loop
Close #1
End Sub