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
// Remove selected annotation.
private void RemoveSelectedAnnotation()
{
AnnotationCollection collection = annotationViewer1.Annotations.SelectedCollection;
AnnotationBase annot = collection.SelectedAnnotation;
// remove annotation
collection.SelectedAnnotation = null;
int index = collection.IndexOf(annot);
collection.Remove(annot);
annot.Dispose();
// select next annotation
if (collection.Count != 0)
{
if (index == collection.Count)
index--;
collection.SelectedAnnotation = collection[index];
}
}
private void annotationViewer1_DeleteKeyPressed(object sender, EventArgs e)
{
// insert your code here
// remove selected annotation
if (annotationViewer1.FocusedImage == null)
return;
if (annotationViewer1.Focused && annotationViewer1.Annotations.SelectedCollection.SelectedAnnotation != null)
{
RemoveSelectedAnnotation();
return;
}
}
Sincerely