Description
Load a previously saved overlay collection.
-
Return Type
-
None
-
Syntax
-
object.Load Source, [TagNumber]
The Load Method syntax has these parts: |
| object | An expression evaluating to an object of type McGraphOverlay. | | Source | Required. A Variant value. Either a string file name, an IStream object, an IStorage object, a McStream object or missing. If a file name is given, the file is read as a compond document file holding the saved overlay information previously written via a call to the Save method. If an IStorage is supplied, a stream named the ClipboardName is used as the source for the loaded overlay information.
If an McStream object is given or the Source argument is missing, then load information is read from the TIFF tag number given by the TagNumber argument. If the Source argument is missing, then the McGraphOverlay instance must be an operator with an ancestor McImage. Furthermore, this ancestor image must have its McImage.File object set to some file name. The overlay information is read from the specified TIFF tag, which must have been previously written with a call to the Save method.
| | TagNumber | Optional. A Long value. If given, this is the TIFF tag number to use for the load. If missing, then a numeric tag value of mcttOVERLAY_ANNOT is implied if the ClipboardName property is McImage.AnnotationOverlay, and a numeric tag value of mcttOVERLAY_AOI is implied if the overlay is an operator with a parent McRegions named Aoi. If this McGraphOverlay is not one of these two special cases, then you must supply the desired tag number.
| Remarks
This method is a friendly front end for the IPersistFile and IPersistStream interfaces that McGraphOverlay exposes. The method supports loading from a disk file, from an IStream, from an IStorage or from a specified tag number in a Tiff file.
All existing graph objects and user-defined templates are cleared before loading the new overlay data. Existing programatically defined templates (see the Template property) are retained.
Exceptions
The call will fail if a TagNumber value or McStream object is supplied, but the source McStream object does not support tags. If the file format supports tags, but the tag is not present, then the McGraphOverlay is just emptied of any user-saved Templates (created by a call to McGraphObj.SaveAsTemplate) and of any McGraphObj instances, and success is returned.
Notes
The load of the AnnotationOverlay shown in the first example is done automatically for you whenever an image file is opened that supports tags.
When a Tag value or McStream is given as the Source, then the McImage.File or McStreamForTags object is left open. To finish the read, the client must call the McStream.Close method, however, you should never do this for the McImage.File object, since this is handled by the application.
|