开发者

Scroll image by dragging the mouse

I have an image inside a scroll viewer and buttons to zoom in and zoom out. Now when the image is zoomed, i want t开发者_Python百科o be able to click on the image and drag in any direction as if i was scrolling in those directions. How to do this? thanks.


I posted a similar question here a while back. I was trying to do the same type of thing with a ScrollViewer and was able to get it to work, but it was definately limited. We used this control which worked great for us.

<zoom:ZoomControl x:Name="zoom" 
                  InitialZoom="1" 
                  Background="Blue" 
                  ZoomEnabled="True" 
                  PanEnabled="True" 
                  Height="400" 
                  Width="600" 
                  ZoomStep="1" 
                  MaxZoom="10" 
                  MinZoom="1">
    <StackPanel>
        <Button Content=" Test " Margin="20"/>
        <Image Source="C:\Documents and Settings\user\Desktop\IMG_5018.JPG" Height="50"/>
    </StackPanel>

</zoom:ZoomControl>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜