Using annotationManager As AnnotationManager = New AnnotationManager()
If annotationManager.InitFromFile("arrow.jpeg") = GdPictureStatus.OK Then
For p As Integer = 1 To annotationManager.PageCount
If annotationManager.SelectPage(p) = GdPictureStatus.OK Then
Dim annotCount As Integer = annotationManager.GetAnnotationCount()
If annotationManager.GetStat() = GdPictureStatus.OK Then
For a As Integer = 0 To annotCount - 1
Dim type As GdPicture14.Annotations.Annotation.GdPictureAnnotationType = annotationManager.GetAnnotationType(a)
If annotationManager.GetStat() = GdPictureStatus.OK Then
If type = GdPicture14.Annotations.Annotation.GdPictureAnnotationType.AnnotationTypeLineArrow Then
Dim flipx As Boolean = False, flipy As Boolean = False
If annotationManager.GetAnnotationFlipState(a, flipx, flipy) = GdPictureStatus.OK Then
annotationManager.SetAnnotationFlipState(a, Not flipx, Not flipy)
End If
End If
End If
Next
If annotationManager.GetStat() = GdPictureStatus.OK Then annotationManager.SaveAnnotationsToPage()
If annotationManager.GetStat() <> GdPictureStatus.OK Then Exit For
Else
Exit For
End If
Else
Exit For
End If
Next
If annotationManager.GetStat() = GdPictureStatus.OK Then
If annotationManager.SaveDocumentToJPEG("arrow_flipped.jpeg", 75) = GdPictureStatus.OK Then
MessageBox.Show("Done!", "AnnotationManager.SetAnnotationFlipState")
Else
MessageBox.Show("The file can't be saved. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SetAnnotationFlipState")
End If
Else
MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SetAnnotationFlipState")
End If
annotationManager.Close()
Else
MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SetAnnotationFlipState")
End If
End Using
using (AnnotationManager annotationManager = new AnnotationManager())
{
if (annotationManager.InitFromFile("arrow.jpeg") == GdPictureStatus.OK)
{
for (int p = 1; p <= annotationManager.PageCount; p++)
{
if (annotationManager.SelectPage(p) == GdPictureStatus.OK)
{
int annotCount = annotationManager.GetAnnotationCount();
if (annotationManager.GetStat() == GdPictureStatus.OK)
{
for (int a = 0; a < annotCount; a++)
{
GdPicture14.Annotations.Annotation.GdPictureAnnotationType type = annotationManager.GetAnnotationType(a);
if (annotationManager.GetStat() == GdPictureStatus.OK)
{
if (type == GdPicture14.Annotations.Annotation.GdPictureAnnotationType.AnnotationTypeLineArrow)
{
bool flipx = false, flipy = false;
if (annotationManager.GetAnnotationFlipState(a, ref flipx, ref flipy) == GdPictureStatus.OK)
annotationManager.SetAnnotationFlipState(a, !flipx, !flipy);
}
}
}
if (annotationManager.GetStat() == GdPictureStatus.OK)
annotationManager.SaveAnnotationsToPage();
if (annotationManager.GetStat() != GdPictureStatus.OK) break;
}
else break;
}
else break;
}
if (annotationManager.GetStat() == GdPictureStatus.OK)
{
if (annotationManager.SaveDocumentToJPEG("arrow_dest.jpeg", 75) == GdPictureStatus.OK)
MessageBox.Show("Done!", "AnnotationManager.SetAnnotationFlipState");
else
MessageBox.Show("The file can't be saved. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SetAnnotationFlipState");
}
else
MessageBox.Show("Error! Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SetAnnotationFlipState");
annotationManager.Close();
}
else
MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SetAnnotationFlipState");
}