Dim annotationManager As AnnotationManager = New AnnotationManager()
If (annotationManager.InitFromFile("image1.jpg") = GdPictureStatus.OK) AndAlso
(annotationManager.PageCount > 0) AndAlso (annotationManager.SelectPage(1) = GdPictureStatus.OK) AndAlso
(annotationManager.SaveAnnotationsToXMP("annots.xml") = GdPictureStatus.OK) Then
annotationManager.Close()
If (annotationManager.InitFromFile("image2.jpg") = GdPictureStatus.OK) AndAlso
(annotationManager.PageCount > 0) AndAlso (annotationManager.SelectPage(1) = GdPictureStatus.OK) AndAlso
(annotationManager.LoadAnnotationsFromXMP("annots.xml") = GdPictureStatus.OK) Then
If annotationManager.SaveDocumentToJPEG("image2.jpg", 75) = GdPictureStatus.OK Then MessageBox.Show("Done!", "AnnotationManager.SaveAnnotationsToXMP")
Else
MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SaveAnnotationsToXMP")
End If
annotationManager.Close()
Else
MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SaveAnnotationsToXMP")
End If
annotationManager.Dispose()
AnnotationManager annotationManager = new AnnotationManager();
if ((annotationManager.InitFromFile("image1.jpg") == GdPictureStatus.OK) &&
(annotationManager.PageCount > 0) && (annotationManager.SelectPage(1) == GdPictureStatus.OK) &&
(annotationManager.SaveAnnotationsToXMP("annots.xml") == GdPictureStatus.OK))
{
annotationManager.Close();
if ((annotationManager.InitFromFile("image2.jpg") == GdPictureStatus.OK) &&
(annotationManager.PageCount > 0) && (annotationManager.SelectPage(1) == GdPictureStatus.OK) &&
(annotationManager.LoadAnnotationsFromXMP("annots.xml") == GdPictureStatus.OK))
{
if (annotationManager.SaveDocumentToJPEG("image2.jpg", 75) == GdPictureStatus.OK) MessageBox.Show("Done!", "AnnotationManager.SaveAnnotationsToXMP");
}
else MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SaveAnnotationsToXMP");
annotationManager.Close();
}
else MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SaveAnnotationsToXMP");
annotationManager.Dispose();