background.bas

来自「Surfer是地学中常用的一个软件」· BAS 代码 · 共 48 行

BAS
48
字号
'============================================================================
'BACKGROUND.BAS
'
'This script demonstrates the following:
'	Grid a sample data file
'	Create a contour map
'	Create checkered background color
'
'												SKP 9/99 Surfer 7
'============================================================================

Sub Main
	'Declare the variable that will reference the application
	Dim SurferApp As Object
	
	'Creates an instance of the Surfer Application object 
	' and assigns it to the variable named "SurferApp"
	Set SurferApp = CreateObject("Surfer.Application")
	
	'Make Surfer visible
	SurferApp.Visible = True
	
	'Set path
	Path=SurferApp.Path+"\Samples\"
	
	'Declares Doc As an Object
	Dim Doc As Object
	
	'Creates a new document with variable name "Doc"
	Set Doc = SurferApp.Documents.Add
	
	'Grid the data file
	SurferApp.GridData (DataFile:=path+"demogrid.dat", _
		ShowReport:=False, Algorithm:=srfKriging, OutGrid:=path+"sample.grd")
	
	'Declares MapFrame as an Object
	Dim MapFrame As Object
	
	'Creates a contour map & assigns the map frame to the variable "MapFrame"
	Set MapFrame = Doc.Shapes.AddContourMap(GridFileName:=Path+"sample.grd")
	
	'Changes the map background
	MapFrame.BackgroundFill.Pattern = "Diagonal Cross"
	MapFrame.BackgroundFill.BackColor = srfColorRed
	MapFrame.BackgroundFill.ForeColor = srfColorIceBlue	
	
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?