CreateSnapshot()
Summary
Stores a snapshot image of the map as currently displayed.
Syntax
snapshot_name = CreateSnapshot(string map_name, string proposed_name)
| Argument | Contents |
|---|---|
| map_name | The map to snapshot |
| proposed_name | Desired name for snapshot |
Returns
A string indicating the actual name of the snapshot, or null if an error occurred while creating the snapshot.
Notes
-
Snapshots allow you to save multiple map images and their associated scopes so that they are linked to a single map file. This lets you switch between them quickly.
-
While a map is open, snapshots are stored in a file on disk that has an arbitrarily file name with an extension of .SNP. This file is in Windows bitmap format. When a map is saved and closed, all snapshot files are compressed into the map file and the disk files are deleted. When the map is opened again, the files are expanded onto disk.
-
Snapshot files can be hand edited using any paint program to enhance their appearance.
Example
SetScale(null, 20000.0)
RedrawMap()
snap1 = CreateSnapshot(null, "Map at 1:20,000")
SetScale(null, 100000.0)
RedrawMap()
snap2 = CreateSnapshot(null, "Map at 1:100,000")
Error Codes
| Error Type | Meaning |
|---|---|
| NotFound | The specified map does not exist |
See Also
| Function | Summary |
|---|---|
| SaveMapToBitmap() | Saves the map image as a Windows bitmap file |
| ShowSnapshot() | Displays a snapshot and sets the map scope to match |
| GetSnapshot() | Gets the scope and image file of a snapshot |
| GetSnapshots() | Gets a list of all snapshots associated with a map |
| ConstructSnapshot() | Convert a customized image file into a map snapshot |
| DeleteSnapshot() | Removes a snapshot from a map and deletes its image file |