Mouse wheel not working on digital zoom

I have a standalone client using ImageViewerWpfControl. Digital zoom is enabled and works but it is not possible to zoom in and out with the mouse wheel.

I have used snoop to verify that the mouse wheel events are propagated to the image viewer. What have I missed? I have compared with the ImageViewerClient sample project and I think I set up the player the right way.

In a class inherited from UserControl I do:

         var imageViewerControl = new ImageViewerWpfControl
         {
            EnableVisibleHeader = false,
            EnableDigitalZoom = true,
            MaintainImageAspectRatio = true
         };
 
         Content = imageViewerControl
 
         imageViewerControl.CameraFQID = item.FQID;
         imageViewerControl.Initialize();
         imageViewerControl.Connect();

I just tried the sample and it works fine, and I cannot really see any difference compared to what you are doing apart from you not creating the control in XAML, but I cannot see how that should do any difference (unless there is something different in how events are propagated?).

Are you using latest version of SDK (2021 R2)?

Yes, I am using 2021 R2 but this has been an issue since my first implementation 2-3 years back.

I will try to inspect the mouse wheel events. Maybe there is something with the position origin of the events.

I have now compared the MouseWheel event on ImageViewerWpfControl between my application and the ImageViewerClient-sample. I see that in my application I get a RectanglePtzModeHandler as the OriginalSource and in the sample I get a PtzOverlayControl. Maybe this is the reason why mousewheel digitalzoom is not working. Any ideas why OriginalSource differs?

Managed to figure out what I was missing *sigh*. Did not know I had to set Selected on the player for digital zoom to work.

Hi Ola. Glad you found out what was the difference and thanks a lot for reporting back with the solution.

I agree that this is not obvious and we’ll make sure to update the documentation, so that others do not have to struggle the same as you.

Once again thanks for contributing!

Kr,

Peter

Just ran into another side-effect of setting Selected on the ImageViewerWpfControl. Obviously, if you have the player connected to a playbackcontroller (playback mode) the timeline tries to adjust to the selected player. If we set Selected on all players, since we want digital zoom always enabled on all players, the timeline tries to adjust to all players and everything gets messed up. The timeline constantly jumps around when you pause playback. When the playbackcontroller is played timeline behaves as normal.

Is there a way to have mouse wheel digital zoom without any effect on the playbackcontroller?

Unfortunately the feature is designed so that you should only have one player Selected at a time. Maybe you can implement it so that you change which player is selected based on MouseHover events so that the digital zoom will always be enabled for the image viewer on which the operator is currently hovering the mouse?