Rython
Rython

Reputation: 627

Scrolling image inside ScrollViewer on tablet (Windows Store app, C#)

Inside ScrollViewer control I have a large image and I want to use scroll bars to move that image inside ScrollViewer. See XAML code below:

<ScrollViewer HorizontalAlignment="Left" Height="282" Width="554" 
              HorizontalScrollBarVisibility="Visible" VerticalScrollMode="Enabled">
  <Image HorizontalAlignment="Left" Margin="0,0,0,0"  VerticalAlignment="Top"
         Source="Assets/big_image.jpg" Stretch="None" ManipulationMode="None"/>
</ScrollViewer>

This works fine on my PC. I can use mouse to move image inside ScrollViewer by using scrollbars. But when I deploy application on the tablet, I cannot do anything. The scrollbars are not visible and I cannot use gestures to manipulate the image. Does anyone know how can I solve this problem?

Upvotes: 1

Views: 2228

Answers (1)

MrSourness
MrSourness

Reputation: 66

There is a Microsoft example with similar functionality:

http://code.msdn.microsoft.com/windowsapps/XAML-ScrollViewer-pan-and-949d29e9

This example uses a Scrollviewer with an inside image to show the capabilities of the ScrollViewer control to pan and zoom. I tried it with a tablet and it works well.

Hope it helps.

Upvotes: 2

Related Questions