This sample script in this article demonstrates how to create a contour map and export to bitmap using Scripter.
To run this script:
- Copy the script below, or download the attached BAS file: ExportBitmap.bas.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Surfer.
- Double click on Scripter.exe to launch Scripter.
- Press Ctrl+A to select all of the existing lines then press Delete.
- If you copied this script, press Ctrl+V to paste it into Scripter. If you downloaded it, click File | Open, select the BAS file from your downloads directory, and click Open.
- Click Script | Run to run the script.
*********
'=================================================================== 'ExportBitmap.bas ' 'This script demonstrates the following: ' ' Create a contour map ' Export to bitmap '=================================================================== Sub Main Dim SurferApp As Object Set SurferApp = CreateObject("Surfer.Application") SurferApp.Visible = True Path = SurferApp.Path + "\samples\" Dim Plot As Object Set Plot = SurferApp.Documents.Add Dim MapFrame As Object Set MapFrame = Plot.Shapes.AddContourMap(GridFileName:=Path+"demogrid.grd") 'Export to Bitmap with 200 DPI resolution Plot.Export(FileName:=Path+"demogrid.bmp", Options:="Defaults=1,HDPI=200,VDPI=200,ColorDepth=4") End Sub
Updated November 12, 2018
Comments
0 comments
Please sign in to leave a comment.