Zoom Panel Minimum Zoom
#1
Hi,

I am trying to add the ZoomPanel to my image editing application. It works so far but I can not seem to figure out how to zoom out past the ZoomPanel boundaries.

Here is an image of my Minimum Zoom, I can not zoom out further than that.

   


And here is my code:


Code:
<UserControl x:Class="Electric.View.CanvasView"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:ab2d="clr-namespace:Ab2d.Controls;assembly=Ab2d.Controls.ZoomPanel"
            xmlns:local="clr-namespace:Electric.View"
            DataContext="{Binding Source={StaticResource Locator}, Path=Canvas}"
            mc:Ignorable="d"
            d:DesignHeight="800" d:DesignWidth="800"
            Background="Green">
   <Grid>
       <ab2d:ZoomPanel Name="ZoomPanel1" ZoomMode="Rectangle" VerticalAlignment="Center" HorizontalAlignment="Center"
           ViewboxLimits="0 0 1 1"
            ViewboxMinSize="0.1 0.1"
            IsViewboxLimited="False"
            IsZoomPositionPreserved="True"
            Viewbox="0 0 1 1">
            <Image
                Source="{Binding ViewerImage}"
                Width="{Binding ViewerImage.Width}"
                Height="{Binding ViewerImage.Height}"/>
        </ab2d:ZoomPanel>
       <ab2d:ZoomController VerticalAlignment="Top" HorizontalAlignment="Right"/>
       <ab2d:ZoomPanelNavigator VerticalAlignment="Top" HorizontalAlignment="Left"/>
       <ab2d:ZoomPanelMiniMap VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
   </Grid>
</UserControl>

Can you help?
#2
When you use ZoomPanelNavigator it by default limits the zoom factor to the limits defined by the ZoomPanelNavigator.MinZoomFactor and ZoomPanelNavigator.MaxZoomFactor properties. But you can disable this by setting the ZoomPanelNavigator.IsZoomPanelLimitedToMinMaxZoomFactors to false. You can also change the limits so they will suit your needs.

See ZoomPanelNavigator sample that comes with ZoomPanel samples project for more info.
Andrej Benedik
#3
Thanks for the quick reply!

That worked. Just wanted to tell you guys how awesome it is that I found thie ZoomPanel. It is going to save me a ton of work.

I will be happy to pay for it once I have checked it all out!
  


Forum Jump:


Users browsing this thread:
1 Guest(s)