Saves ART marks to a stream.
Syntax
Parameters
- artPage
- ART page with marks to save.
- stream
- Stream to which to save annotation marks. The SavePage method works from the
current stream position, so if you are intending to re-write the stream, you need to reset the
stream position to the beginning.
- pageNumber
- Page number to save. First page is 1.
- saveMode
- Saving mode.
- type
- Saving type.
Example
private static void SaveMultipageArt(ImGearARTPage[] igARTPages, string XmlFilePath)
{
using (FileStream fileContent = new FileStream(XmlFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
for (int i = 0; i < igARTPages.Length; i++)
{
if (igARTPages[i] != null)
{
//Must seek to the start of the stream before saving each ImGearARTPage
// to a multipage XML ART file using ImGearSavingModes.APPEND
fileContent.Position = 0;
ImGearART.SavePage(igARTPages[i], fileContent, i, ImGearSavingModes.APPEND, ImGearARTSaveType.XML);
}
}
}
}
Sub SaveMultipageArt(ByVal igARTPages() As ImGearARTPage, ByVal XmlFilePath As String)
Dim fileContent As FileStream
fileContent = Nothing
Try
fileContent = New FileStream(XmlFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite)
For i As Integer = 0 To igARTPages.Length - 1
If (Not (igARTPages(i) Is Nothing)) Then
'Must seek to the start of the stream before saving each ImGearARTPage
' to a multipage XML ART file using ImGearSavingModes.APPEND
fileContent.Position = 0
ImGearART.SavePage(igARTPages(i), fileContent, i, ImGearSavingModes.APPEND, ImGearARTSaveType.XML)
End If
Next
Finally
If Not fileContent Is Nothing Then
fileContent.Close()
End If
End Try
End Sub
See Also