Question

ZoomContentControl's ZoomSlider needs some rework

Posted 8 years ago by Avatar Markus Springweiler
Hello,

while the zoom slider works well for zooming in (> 100%) it's nearly impossible to dose the tracker for zooming out (< 100%).

Just try 'MinZoomLevel="0.05" MaxZoomLevel="20"' (zooms 20x in both directions, up and down): 100% is nearly at the bottom but I would expect it to be centered.

Additionally a GoogleEarth like slider which just controls the zoom-in/out-speed while being dragged (and snapping back to center after drag) would be also very cool and handy.

Comments (8)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Markus,

You're right, it should be tweaked. We currently just use a normal Slider going from MinZoomLevel to MaxZoomLevel. We've added a higher priority TODO item for this so it works better.

Actipro Software Support
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Markus,

Forgot to post this last week, but we tweaked the Slider so it works a little better. We also added support for "stops", so you can specify desired zoom levels when stepping through the Slider values (i.e. 10%, 25%, 33%, 50%, 75%, 100%, ...). We have a QuickStart that shows how this is accomplished also.

This change was included in WPF Studio 2010.1 build 0523.

[Modified at 06/28/2010 10:22 AM]

Actipro Software Support
Posted 8 years ago by Markus Springweiler
Hello,

I don't want to seem picky but now zooming in is just not smoothly controllable any more:

Take the 0.05-20 sample again: When I move the slider slowly from the bottom to the top then near the center I can move the mouse pixel by pixel and get: 97%, 98%, 99%, 114%, 160%, 210% -- nice acceleration but doesn't feel right.

I assume smooth wheel-zooming can be achieved by well chosen custom stops -- but the slider... I think a slider which just controls the current speed of zooming in/out while holding it, and snapping back to center on MouseUp, could be better suited.

Example for custom stops which feel natural (try to use the slider near 100% -- impossible):
    const double MaxZoom = 32;
    this.zoomer.MaxZoomLevel = MaxZoom;
    this.zoomer.MinZoomLevel = 1 / MaxZoom;
    this.zoomer.ZoomLevelStops = new DoubleCollection { 1 };
    var x = 1.0;
    var factor = Math.Sqrt(Math.Sqrt(2));
    while ( x < ( MaxZoom - 0.1 ) )
    {
        x *= factor;
        this.zoomer.ZoomLevelStops.Add(x);
        this.zoomer.ZoomLevelStops.Add(1 / x);
    }
[Modified at 07/02/2010 04:00 AM]
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Markus,

Yeah, that's the problem introduced when trying to "center" a certain value, as the entire scale is no longer linear. The sliders we looked at with a center value, would snap to the "stops". They didn't allow zooming to any arbitrary zoom level. We have a TODO item marked down for this feature, so as you scroll it would snap to any custom stops.

We still have a TODO item marked down to look at the "Google" style slider.

Actipro Software Support
Posted 3 years ago by Markus Springweiler

more than 4 years later -- did change anything since then? (I was in hope to find a "UseLogarithmicScale" property or something similar.)

[Modified 3 years ago]

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

Hi Markus,

Nothing has changed recently other than the ZoomLevelStops capability.  How specifically would you like to see those changed?  I'm not sure that a logarithmic scale would be a good solution though for determining zoom levels as it seems like it might put some values into bad ranges/intervals.


Actipro Software Support
Posted 2 years ago by Markus Springweiler

Another 2 years have passed and the slider is still more kind of an annoyance than useful in a scenario where relative to a 100% view one wants to both zoom in and out by a factor of 32:

If you drag the slider pixel by pixel from the top to the bottom then the visual zoom accelerates two times, each phase with nearly uncontrollable results at the end of the phase: At exactly 100% the second acceleration phase starts with a snap to nearly zero acceleration.

I still have defined many hard coded (logarithmic) zoom stops (see msg from 2010) which at least enable smooth zooming with constant speed when using the mouse wheel or the +- buttons.

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

We're going to make updates to this to use an exponential scale.  That will improve the zooming to be much smoother with an improved curve that visually feels right.  The ZoomStep property will change to become the step used for the power increments when building out zoom stops.


Actipro Software Support
Information The latest build of this product (2017.2 build 0664) was released 5 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.