locked
Unable to pan image view properly

    Question

  • I'm trying to enable my image control to be pannable in all drections am able to pan but can only pan horizontally and vertcially. What can be done in order to achieve the functionality of panning an image in any direction?

    <ScrollViewer x:Name="ImageScrollViewer"  HorizontalAlignment="Stretch" HorizontalScrollBarVisibility="Auto" VerticalAlignment="Stretch" VerticalScrollBarVisibility="Auto" MinZoomFactor="0.5" MaxZoomFactor="1.5">
                <Grid>
                    <Image x:Name="Image"   Source="Assets/map.jpg"  Stretch="Uniform" Grid.Column="0" Grid.Row="0" />
                </Grid>
            </ScrollViewer>

    Wednesday, April 29, 2015 12:42 PM

Answers

  • Add this to the ScrollViewer tag:
    IsHorizontalRailEnabled="False" IsVerticalRailEnabled="False"


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, April 30, 2015 1:01 AM
    Moderator

All replies

  • Horizontal and Vertical *is* every direction. I'm not sure what else you are trying to do.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, April 29, 2015 5:02 PM
    Moderator
  • Trying to pan an image whether the finger is dragged, so not just horizontally and vertically, e.g. if I drag the image in circles, the image should move in circles just like the photo viewer.
    Wednesday, April 29, 2015 6:06 PM
  • Add this to the ScrollViewer tag:
    IsHorizontalRailEnabled="False" IsVerticalRailEnabled="False"


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, April 30, 2015 1:01 AM
    Moderator