Page 1 of 1

AnnotationBoundingRect of WpfAnnotationViewer not working properly?

Posted: Tue Aug 20, 2019 10:21 pm
by AlexanderJ
Hello,

we use WpfAnnotationViewer in our project to show an image and create/draw annotations on it.
We want that the user is only able to draw/create annotations inside the image but not outside of it.

To achieve that we thought it's enough to set IsAnnotationBoundingRectEnabled to true and AnnotationBoundingRect to Rect.Empty if necessary, at least that is what I would expect after reading the documentation of these properties.

Unfortunately this isn't working properly for some annotations you provide (we didn't create any custom annotations yet).
For example creating an ellipse or rectangle annotation is only possible inside the image boundaries, using the freehand annotation I'm still able to draw outside the image boundaries. Also the line annotation isn't behaving correctly in my opinion, you can only start inside the image boundaries but you can end it outside the image boundaries.
As long as you don't move or touch the freehand/line annotation after creation it will stay at the position it was drawn..

The above mentioned annotations are those I've tested, not sure if other annotations you provide also won't stay inside the image boundaries...
Am I missing something to achieve the behaviour for freehand/line annotations to allow drawing/creation only inside image boundaries when above mentioned settings are applied to WpfAnnotationViewer or is this a bug?

Thanks

Re: AnnotationBoundingRect of WpfAnnotationViewer not working properly?

Posted: Thu Aug 22, 2019 2:42 pm
by Alex
Hello Alexander,

In current version WPF annotation viewer allows to bound only building/transformation of rectangle-based annotations. In next minor version (8.8.0.7) we will add the ability to bound building/transformation of all annotation types.

Best regards, Alexander

Re: AnnotationBoundingRect of WpfAnnotationViewer not working properly?

Posted: Fri Aug 23, 2019 4:52 pm
by AlexanderJ
Great thanks for the information.

Re: AnnotationBoundingRect of WpfAnnotationViewer not working properly?

Posted: Thu Sep 05, 2019 5:18 pm
by Alex
Hello Alexander,

In version 8.8.0.7 we fixed the bug in algorithm that bounds building/transformation of annotations in WPF image viewer. Please use version 8.8.0.7 and let me know if you will have any question or problem.

Best regards, Alexander