VintaSoft Imaging .NET SDK and Plug-ins Discussions

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Board index < VintaSoft Imaging < VintaSoft Imaging .NET SDK and Plug-ins Discussions

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

Programmatically delete annotation



Programmatically delete annotation

Post by iansml »

Hi,

Is there any way I can programmatically remove an annotation? I am able to hide it using:
imageViewer1.SelectedAnnotation.Visible = false;
but it is still present in the ImageViewer.Annotations collection. I want it to be removed completely (like when I select an annotation and delete it manually using the delete key).

Thanks


Re: Programmatically delete annotation

Post by Alex »

Hi Ian,

Thank you for your message. You can use the Remove method of the AnnotationCollection class. Here is an example:
AnnotationBase annoToRemove = annotationViewer1.Annotations[imageIndex][indexOfAnnoToRemove];
annotationViewer1.Annotations[imageIndex].RemoveAt(annoToRemove);
We will redefine the RemoveAt method of the AnnotationCollection class in next version of library and it will work correctly.

Best regards, Alexander


Page 1 from 1: 1