0

When the phone in the portrait position than picture with Portrait and Landscape orientation is fits to the screen. When phone in Landscape position than pictures with Portrait orientation is not fits to the scree and user have to scroll them to see full picture. For example my screen in Portrait position w/h= 447/ 585 and 585/ 447 in Landscape. In Portrait position of the phone, my picture with Portrait orientation fits to the size 447/ 585, but in Landscape position same picture become 585 in Width and Height growing in proportion to the max possible let’s say 800p I know it is because ScrollViewer and Auto size, but I want to keep this because I have some text I want to scroll.
How I can limit the image Height when the phone in Portrait position. My code:

<ScrollViewer x:Name="ContentGrid" Grid.Row="1" >
<controls:Pivot x:Name="pivot1" Title="New pictures" SelectionChanged="SelectionChangedEventHandler">
<controls:PivotItem>
<StackPanel>
<Image Height="Auto" Width="Auto" HorizontalAlignment="Center" Margin="9,6,0,0" Name="image1" Stretch="UniformToFill" VerticalAlignment="Center"  />
</StackPanel>
</controls:PivotItem>
</controls:Pivo
</ScrollViewer>

Any suggestion? Found next questions, but didn’t get any useful

Scrollbar Size in ScrollViewer

Silveright ScrollViewer with Image and ScaleTransform

https://stackoverflow.com/questions/6938658/size-grid-in-combination-with-scrollviewer

Help with Image and ScrollViewer - WPF

Community
  • 1
  • 1
infoexpert.it
  • 345
  • 1
  • 5
  • 17

1 Answers1

0

I'm not 100% clear on your question but I think that using Strestch="Uniform", on the image, will give you the effect you're after.

Matt Lacey
  • 65,560
  • 11
  • 91
  • 143