Dim annotStream As System.IO.MemoryStream = New System.IO.MemoryStream()
Dim annotationManager As AnnotationManager = New AnnotationManager()
If (annotationManager.InitFromFile("source.tiff") = GdPictureStatus.OK) AndAlso
(annotationManager.SaveAnnotationsToXMP(annotStream) = GdPictureStatus.OK) Then
annotationManager.Close()
If (annotationManager.InitFromFile("dest.tiff") = GdPictureStatus.OK) AndAlso
(annotationManager.LoadAnnotationsFromXMP(annotStream) = GdPictureStatus.OK) Then
If annotationManager.SaveDocumentToTIFF("dest_updated.tiff", TiffCompression.TiffCompressionAUTO) = GdPictureStatus.OK Then
MessageBox.Show("Done!", "AnnotationManager.SaveAnnotationsToXMPEx")
End If
Else
MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SaveAnnotationsToXMPEx")
End If
annotationManager.Close()
Else
MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SaveAnnotationsToXMPEx")
End If
annotationManager.Dispose()
annotStream.Dispose()
System.IO.MemoryStream annotStream = new System.IO.MemoryStream();
AnnotationManager annotationManager = new AnnotationManager();
if ((annotationManager.InitFromFile("source.tiff") == GdPictureStatus.OK) &&
(annotationManager.SaveAnnotationsToXMPEx(annotStream) == GdPictureStatus.OK))
{
annotationManager.Close();
if ((annotationManager.InitFromFile("dest.tiff") == GdPictureStatus.OK) &&
(annotationManager.LoadAnnotationsFromXMP(annotStream) == GdPictureStatus.OK))
{
if (annotationManager.SaveDocumentToTIFF("dest_updated.tiff", TiffCompression.TiffCompressionAUTO) == GdPictureStatus.OK)
MessageBox.Show("Done!", "AnnotationManager.SaveAnnotationsToXMPEx");
}
else MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SaveAnnotationsToXMPEx");
annotationManager.Close();
}
else MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SaveAnnotationsToXMPEx");
annotationManager.Dispose();
annotStream.Dispose();