Image zooming without interpolation
#1
Hi

I am new to WPF and need an image control for displaying images.

I do have specific requirements that I do not know is supported, I hope you can help me clarify these items:

Is it possible to lock the aspect ratio when zooming with rectangle?
The zoom would naturally not be the exact rectangle, but a rectangle with the same top,left point and then fitted width or height to fit the size of the control.

During mouse wheel zooming is the zooming done around the center of the mouse position (like std. MS photo viewer)? Or is the zooming around the center of the control?

Is "integer" zoom supported so that there is no interpolation done in the images?.
I would perfer zoom out of factors 1/n (where n is an integer) and zoom in of n (e.g. 1x, 2x, 3x...)

Best regards,
Simon
#2
(04-30-2015, 11:49 AM)SKS Wrote: Is it possible to lock the aspect ratio when zooming with rectangle?

Aspect ratio is already locked so the image's proportions are not changed. But if you would not like the locked aspect ratio you can set the Stretch property on ZoomPanel to Fill.


(04-30-2015, 11:49 AM)SKS Wrote: During mouse wheel zooming is the zooming done around the center of the mouse position (like std. MS photo viewer)? Or is the zooming around the center of the control?

You have both options. By default the zooming is done at the mouse position. But if you set the IsZoomPositionPreserved to false, the zooming will always happen at the center position of the currently shown image.

(04-30-2015, 11:49 AM)SKS Wrote: Is "integer" zoom supported so that there is no interpolation done in the images?.
I would perfer zoom out of factors 1/n (where n is an integer) and zoom in of n (e.g. 1x, 2x, 3x...)

You can probably achieve that with setting scaling mode to NearestNeighbor- this can be done with (MyImage is the image or other content inside ZoomPanel):
RenderOptions.SetBitmapScalingMode(MyImage, BitmapScalingMode.NearestNeighbor);
Andrej Benedik
  


Forum Jump:


Users browsing this thread:
1 Guest(s)