我用VB调用surfer8来画图,先是打开了一个srf文件,因为要用到这个文件当底图文件,里面有站点、水系之类的,然后数据网格,然后白化,然后等值线图,然后载入色标,然后全选,覆盖地图。
手动画图时这个步骤,编程也是这个步骤,但手动的时候,覆盖后,原先最开始打开的srf文件里面的底图会被等值线图覆盖,看不到原先里面的水系等信息,然后手动把等值线图拖到之前底图上。这步程序不清楚怎么实现,上网查到这个,但不是很懂,也没实现成功。请教懂的能告诉下,谢谢!
“
叠放次序。 在无法确定时,须全部选择取消,再选择其中一个为选定。再设置SetZOrder就可以 object.SetZOrder(Zorder) eg: Selection.SetZOrder(Zorder:=srfZOToFront) Shapes("Map").Overlays("Wireframe").SetZOrder(srfZOToFront)
”
我的代码:
Dim srf As New Surfer.Application
Dim poltDoc As Surfer.IPlotDocument
Dim mapFrame As Surfer.IMapFrame
Dim mapContour As Surfer.IContourMap
Dim ColorScale As Surfer.IDiscreteColorScale
Dim mapBase As Surfer.IBaseMap
Dim shpText As Surfer.IText
Dim Axis As Surfer.IAxis
'打开文档
' Set poltDoc = srf.Documents.Add(srfDocPlot)
Set poltDoc = srf.Documents.Open(App.Path & "\ditu.srf")
'网格化
srf.GridData DataFile:=App.Path & "\日照.txt", xCol:=2, yCol:=3, zCol:=4, NumCols:=200, NumRows:=200, xMin:=109, xMax:=116, _
yMin:=31, yMax:=36.5, showreport:=False, outgrid:=App.Path & "\out.grd"
DoEvents
'白化
srf.GridBlank ingrid:=App.Path & "\out.grd", blankfile:=App.Path & "\hhrvalleyborder.bln", outgrid:=App.Path & "\out.grd"
'等值线
Set mapFrame = poltDoc.Shapes.AddContourMap(App.Path & "\out.grd")
'轴线
For Each Axis In mapFrame.Axes
Axis.Visible = False
Next
'等值线属性设置
Set mapContour = mapFrame.Overlays(1)
With mapContour
.FillContours = True
.SmoothContours = srfConSmoothHigh
.Levels.LoadFile App.Path & "\rz.lvl"
End With
'叠放
poltDoc.Shapes.SelectAll
poltDoc.Selection.OverlayMaps
|