简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM