Reputation: 1022
I have a Win 8.1 app which displays an image which I want to allow the pinch/zooming on, to achieve this I put control inside of a .
Depending on the size of the image (usually smaller ones whose resolution is less than the available size), things work fine, however for larger images, it insists on (visually) cutting off the bottom and requiring the manual scrolling down to see it.
The only way around this is to set VerticalScrollBarVisibility & HorizontalScrollBarVisibility to Disabled... which comes with it's own issues. When set, I can pinch to zoom, but it quickly (and automatically) snaps the view back to the upper left corner.
<ScrollViewer Grid.Row="0"
Grid.Column="0"
VerticalScrollBarVisibility="Disabled"
HorizontalScrollBarVisibility="Disabled"
MinZoomFactor=".25"
MaxZoomFactor="10" >
<Image Source="ms-appx:///Assets/Big Test Image.jpg" />
</ScrollViewer>
Any suggestions as to what I need to tweak here or elsewhere to force the image to start fully displayed, and still be zoomable & focusable?
Upvotes: 0
Views: 157
Reputation: 39082
Try adding the following attributes to the ScrollViewer tag:
HorizontalSnapPointsType="None" VerticalSnapPointsType="None" ZoomSnapPointsType="None"
IsHorizontalRailEnabled="False" IsVerticalRailEnabled="False" ManipulationMode="All"
Upvotes: 1