- 积分
- 3288
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-7-7
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如图所示,我想让等值线像黄色那幅图一样显示出来,该如何做,附上代码
With dlgCommon1
.DialogTitle = "打开数据文件"
.Flags = 0
.CancelError = True
.FileName = ""
.Filter = "数据文件 (*.dat)|*.dat"
.ShowOpen
If Len(.FileName) = 0 Then
Exit Sub
End If
strinfile = .FileName
End With
strGridFile = Left(strinfile, Val(InStrRev(strinfile, ".")) - 1) + ".grd"
Set SurferApp = CreateObject("Surfer.Application")
SurferApp.Visible = False
SurferApp.GridData DataFile:=App.Path & "\雨量.dat", xCol:=1, yCol:=2, zCol:=3, Algorithm:=2, DupMethod:=2, ShowReport:=False, OutGrid:=App.Path & "\差值后.grd", xMin:=105.589, xMax:=106.125, yMin:=28.95, yMax:=29.56
SurferApp.GridBlank InGrid:=App.Path & "\差值后.grd", BlankFile:=App.Path & "\永川边界.bln", OutGrid:=App.Path & "\差值后.grd"
Set Plot = SurferApp.Documents.Add(1)
Set ContourMapFrame = Plot.Shapes.AddContourMap(App.Path & "\差值后.grd ")
Set ContourMap = ContourMapFrame.Overlays(1)
ContourMap.Levels.LoadFile (App.Path & "\降水")
ContourMap.SmoothContours = 4
ContourMap.ShowColorScale = True
ContourMap.FillContours = True
Set baseMap = Plot.Shapes.AddBaseMap(ImportFileName:=App.Path & "\永川边界.bln")
Set postmapframe = Plot.Shapes.AddPostMap(dataFileName:=App.Path & "\站点信息.txt", xCol:=1, yCol:=2, LabCol:=3)
Set postmap1 = postmapframe.Overlays(1)
Set MkFormat = postmap1.Symbol
With MkFormat
.Size = 0.05
.Index = 12
End With
Set lbFont = postmap1.LabelFont
With lbFont
.Face = "宋体"
.Size = 8
End With
Set baseMap = Plot.Shapes.AddBaseMap(ImportFileName:=App.Path & "\永川边界.bln")
Set postmapframe = Plot.Shapes.AddPostMap(dataFileName:=App.Path & "\雨量.dat", xCol:=1, yCol:=2, LabCol:=3)
Set postmap1 = postmapframe.Overlays(1)
Set MkFormat = postmap1.Symbol
With MkFormat
.Size = 0.000000001
.Index = 0
End With
Set lbFont = postmap1.LabelFont
With lbFont
.Face = "黑体"
.Size = 7
End With
Set adtext = Plot.Shapes.AddText(X:=7.2, Y:=3.4, Text:="单位:毫米")
With adtext.Font
.Face = "黑体"
Size = 14
End With
Plot.Shapes.SelectAll
Plot.Selection.OverlayMaps
Plot.Export FileName:=App.Path & "\雨量图.gif", Options:="Width=700,Height=700"
Plot.Close
SurferApp.Quit
Picture1.Picture = LoadPicture(App.Path & "\雨量图.gif")
End Sub
|
|