One thing to keep in mind is that the Display
and DisplayCanvas
use the information about the currently displayed (-)image to scale the overlays correctly (the overlays are displayed in image coordinates, see also https://forum.commonvisionblox.com/t/how-to-use-overlay-and-mouse-click-with-wpf-display-c/611). Conversely this means that if there is no image currently set on the Display.Image
or DisplayCanvas.Image
you won’t see anything because the display/display canvas does not actually know how to scale your overlay.
I’ve put together a very quick and even more dirty demo that shows the concept. Note that it’ll need TwoWay binding on the selected rectangle to work properly. SimpleDemo.zip (466.4 KB)