NotateXpress 13 for .NET - User Guide > How To > Save Annotations > Save Annotations to File, Array, or Stream |
To save annotations to a file, array, or stream, first specify SaveOptions to provide specific instructions for saving the annotations.
Prior to storing the annotations, first specify SaveOptions to provide specific saving instructions.
C# Example |
Copy Code
|
---|---|
// save all annotation layers mysaveOptions.AllLayers = true; // as NotateXpress annotations mysaveOptions.AnnType = AnnotationType.NotateXpress; // provide some information about the annotations notateXpress1.Layers.Comments = "This file was saved today"; notateXpress1.Layers.Subject = "my annotations"; notateXpress1.Layers.Title = "One awesome annotation file"; |
Use the LayerCollection.SaveToFile method to save the layer collection to an annotation file:
C# Example |
Copy Code
|
---|---|
// store to a .nxp annotation file
notateXpress1.Layers.SaveToFile(myFileName, mysaveOptions);
|
NXP annotations files on disk can only be read if they were originally created using SaveToFile(). If they were created using SaveToByteArray() or SaveToMemoryStream(), they cannot be read correctly from disk. |
Use the LayerCollection.SaveToByteArray to save annotations to a byte array:
C# Example |
Copy Code
|
---|---|
// store to a byte array
mybytearray = notateXpress1.Layers.SaveToByteArray(mysaveOptions);
|
Use the LayerCollection.SaveToMemoryStream to save annotations to a memory stream:
C# Example |
Copy Code
|
---|---|
// store to a byte array
mymemorystream = notateXpress1.Layers.SaveToMemoryStream(mysaveOptions);
|
A layer collection can also be copied to another layer collection as follows:
C# Example |
Copy Code
|
---|---|
//copy the layers from one notateXpress control to another
Notatexpress1.Layers = NotateXpress2.Layers;
|