VintaSoft Annotation .NET Plug-in Discussions

Questions, comments and suggestions concerning VintaSoft Annotation .NET Plug-in.

Board index < VintaSoft Imaging < VintaSoft Annotation .NET Plug-in Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Set Annotation visible false



Set Annotation visible false

Post by MichaelHerrmanns »

Hello,

I want to write a function to switch all annotations of a image to visible false or true.
For this I use this code:
Dim images As ImageCollection = AnnotationViewer1.Images
        Dim annotations As AnnotationController = New AnnotationController(images)
        Dim imageIndex As Integer, annoIndex As Integer
        For imageIndex = 0 To images.Count - 1
            Dim imageAnnotations As AnnotationCollection = annotations(imageIndex)
            For annoIndex = 0 To imageAnnotations.Count - 1
                Debug.Print(imageAnnotations(annoIndex).Visible.ToString)

                imageAnnotations(annoIndex).Visible = Not imageAnnotations(annoIndex).Visible

            Next annoIndex
        Next imageIndex
But I must reload the image to see the annoations visible false/true.

Any idea

regards
Michael


Re: Set Annotation visible false

Post by Alex »

Hello Michael,

Your code has logical mistake - you need to use annotation controller associated with annotation viewer instead of creating new annotation controller.

Here is your code:
Dim annotations As AnnotationController = New AnnotationController(images)
and here is correct code:
Dim annotations As AnnotationController = annotationViewer1.Annotations
Best regards, Alexander


Re: Set Annotation visible false

Post by MichaelHerrmanns »

Hello Alex,

Thank you very much.

Now it is working.

Best regards

Michael


Page 1 from 1: 1