|KB no longer maintained - MapViewer is a Legacy Product. Legacy Products are still supported, but no longer receive new features or updates. Many of MapViewer's features have been moved to Surfer. Please contact email@example.com with any questions.|
The Plot.Export command is accessible from the PlotDocument object. After you have a PlotDocument (Plot), you can export the map using the Export command.
To run this script:
- Copy the text below, from the Sub Main start line to the End Sub end line.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\MapViewer 8\Scripter.
- Double click on Scripter.exe to launch Scripter.
- Press Ctrl+A to select all of the existing lines.
- Press Ctrl+V to paste your copied script over top of these existing lines.
- Click Script | Run to run the script.
Dim mvApp, Plot As Object
Set mvApp = CreateObject("MapViewer.Application")
mvApp.Visible = True
'Open a file so there is something to export
Set Plot = mvApp.Documents.Open(mvApp.ApplicationFolder+"\Samples\FlowMap.gsm")
'Export the map as a bitmap
When you are exporting to a bitmap format, such as a TIF, BMP, JPG, PNG, or GIF, there are some options that are available. These allow you to control the exported image size, color depth, and quality. The most common options are: Width and Height or HDPI and VDPI (dots per inch), ColorDepth, Automatic, and Quality. To use these, type the following into the empty Options string in the example above:
- Width=1024, Height=720 - Sets the width and height of the exported bitmap
- HDPI=300, VDPI=300 - Sets the horizontal and vertical depth per inch of the exported bitmap
- Automatic=False - Turns off automatic compression of the exported bitmap (TIF only)
- Quality=100 - Sets the quality to 100% (JPG only)
- ColorDepth=32 - Sets the ColorDepth using an enumeration value:
- -32=32-bit grayscale
- -16=16-bit grayscale
- -8=8-bit grayscale
- -4=4-bit grayscale
- 1=1-bit color indexed
- 4=4-bit color indexed
- 8=8-bit color indexed
- 24=24-bit color indexed
- 32=32-bit true color with alpha
Updated March 3, 2015