How do I Cancel an Interactive Annotation? C#
Posted: Mon Jan 13, 2020 9:42 pm
How do I programmatically Cancel an Interactive Annotation?
Scenario:
1. User clicks an Annotate button, for example Freehand.
This executes code like: GdView.AddFreeHandAnnotInteractive(Color.Black, myPenWidth, System.Drawing.Drawing2D.LineCap.Flat, System.Drawing.Drawing2D.LineCap.Flat, 1, false);
2. User changes her mind, without clicking in the GdView, and wants to use Text annotation instead. However, the next AddTextAnnotInteractive() process does not cancel the previous AddFreeHandAnnotInteractive() process, so when the user clicks to add Text, the result is FreeHand capture.
My current work-around is to toggle the GdViewer.SetAnnotationEditorMode() just prior to Add*AnnotInteractive code; like the following:
Scenario:
1. User clicks an Annotate button, for example Freehand.
This executes code like: GdView.AddFreeHandAnnotInteractive(Color.Black, myPenWidth, System.Drawing.Drawing2D.LineCap.Flat, System.Drawing.Drawing2D.LineCap.Flat, 1, false);
2. User changes her mind, without clicking in the GdView, and wants to use Text annotation instead. However, the next AddTextAnnotInteractive() process does not cancel the previous AddFreeHandAnnotInteractive() process, so when the user clicks to add Text, the result is FreeHand capture.
My current work-around is to toggle the GdViewer.SetAnnotationEditorMode() just prior to Add*AnnotInteractive code; like the following:
Code: Select all
// there must be a better way to cancel the previous incomplete Add*AnnotInteractive()
GdViewer.SetAnnotationEditorMode(false);
GdViewer.SetAnnotationEditorMode(true);
GdViewer.Add*AnnotInteractive(...);