bbkcylh 发表于 2016-4-27 06:09
说的不清楚,是画一个外框,还是规则格网?
规则格网,我先进行的比较,不过比较这块我还不熟,这是我读文本的时候的代码,- Dim L As Integer
- Dim H(10000) As Double, X(10000) As Double, Y(10000) As Double, Z(10000) As Double
- Dim Xmax As Double, Xmin As Double, Ymax As Double, Ymin As Double
- Sub txt_read()
- Dim txtname As String
- Dim L As Integer
- L = 0 '初始值
- Open "E:\demdata.txt" For Input As #1 '打开文件
- Do While Not EOF(1) '文件读取循环
- If X(L + 1) > X(L) Then
- Xmax = X(L + 1)
- ElseIf Y(L + 1) > Y(L) Then
- Ymax = Y(L + 1)
- Else
- Xmin = X(L + 1)
- Ymin = Y(L + 1)
- End If
- L = L + 1 '个数加1
- Input #1, H(L), X(L), Y(L), Z(L) '读取文件数据, H贮存点序号,XYZ为坐标
- Loop '文件读取循环
- Close #1 '关闭文件
- End Sub
|