Programmatically delete annotation

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

Moderator: Alex

Post Reply
Posts: 31
Joined: Thu Apr 23, 2009 1:57 pm

Programmatically delete annotation

Post by iansml » Wed May 06, 2009 1:52 pm


Is there any way I can programmatically remove an annotation? I am able to hide it using:

Code: Select all

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).


Site Admin
Posts: 1628
Joined: Thu Jul 10, 2008 2:21 pm

Re: Programmatically delete annotation

Post by Alex » Wed May 06, 2009 3:00 pm

Hi Ian,

Thank you for your message. You can use the Remove method of the AnnotationCollection class. Here is an example:

Code: Select all

AnnotationBase annoToRemove = annotationViewer1.Annotations[imageIndex][indexOfAnnoToRemove];
We will redefine the RemoveAt method of the AnnotationCollection class in next version of library and it will work correctly.

Best regards, Alexander

Post Reply