Question

Using ZoomContentControl to manipulate source

Posted 5 years ago by Avatar Donald Scott

Brand new to Actipro, so hoping that I am missing something obvious....

I have an image source that independently generates a WPF BitmapSource.  This class captures MouseDown/Move/Up events for panning and also MouseWheel events for zooming in and out.

I would like to use the ZoomContentControl to manipulate the image using the class routines - and not the routines that ZoomContentControl uses to pan/zoom the image.  In other words, when I move the zoom level selector, instead of the ZoomContentControl zooming the current display - performs a raster zoom), I would like to regenerate the WPF BitmapSource and update the displayed image.  Likewise, when I press the Pan button, I would like to be able to call my own routine that will let me pan the BitmapSource.

Is there an obvious method to do this?

Thanks.


Comments (4)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Donald,

Right now for panning, on ZoomContentControl.OnApplyTemplate we look for a control in the template with name "PART_PanPad" and subscribe to its Pan event.  If you retemplated the control and renamed it, that would prevent our default logic.  You could add your own Pan handler too then.

Similarly, as you modified the control template you could remove the bindings we have for the zoom controls and bind to your own custom zoom properties instead.


Actipro Software Support
Posted 5 years ago by Donald Scott

Um.... did I mention that new to Actipro.  How about new to WPF?  Once I figure out the "retemplate the control" part I will get back to you.,  Thanks.

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Donald,

That basically means set the Template property of the control to something new, either view the control's Template property or via a Setter in a Style for the control.  There's a lot of help on that sort of thing on the web since it's a basic XAML concept.

The thing is that you won't have access to our default XAML styles/templates to clone the template for this control until you are a customer.


Actipro Software Support
Posted 5 years ago by Donald Scott

Will go from eval to paid very soon so I can do that.  Thanks.

In the meantime, I have managed to do what I need to do by using RepeatButtons, Slider and the PanPad from your Navigation control series.  The RepeatButtons and Slider are easy, and by defining my own EventHandler for PanPad, I can regenerate the BitmapSource as required. 

Once I have the paid version, I will look at retemplating the ZoomContentControl.  Thanks.

Information The latest build of this product (2018.1 build 0670) was released 4 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.