Page 1 of 1

Annotation viewer crop WPF

Posted: Wed Mar 22, 2023 4:18 pm
by deedubya
Hi,

I am using latest version of Annotation viewer in WPF. I have tools for annotations and crop and can detect when the annotation ends but cannot seen to find the event which relates to the completion of the crop (WpfCropSelectionTool) as I would like to automatically turn off this tool once it has been exectued.

Thanks

Re: Annotation viewer crop WPF

Posted: Thu Mar 23, 2023 2:38 pm
by Alex
Hi,

If you want to know when WpfCropSelectionTool visual tool executed WpfCropSelectionTool.Crop method, you need to do the following steps:
  • Create MyWpfCropSelectionTool class, which is derived from WpfCropSelectionTool class, and override WpfCropSelectionTool.Crop method:

    Code: Select all

    public class MyCropTool : WpfCropSelectionTool
    {
        public override void Crop()
        {
            base.Crop();
    
            ImageViewer.VisualTool = null;
        }
    }
  • Use MyWpfCropSelectionTool class in image viewer.
Best regards, Alexander

Re: Annotation viewer crop WPF

Posted: Fri Mar 24, 2023 2:04 pm
by deedubya
Thanks will try that.

Re: Annotation viewer crop WPF

Posted: Fri Mar 24, 2023 2:31 pm
by deedubya
Thanks that work great.