I am using a Silverlight 3.0 Image control, setting it's Stretch property="Uniform". Unless I am mistaken, the expected behavior for Stretch="Uniform" is that it should scale the image, maintaining aspect ratio, letterboxing as needed. This works fine for images with landscape orientations, in that they scale up to fill the space, maintaining aspect ratio without cutting off any of the image. It is a complete fail for images with a more vertical or 'portrait' orientation. Instead of scaling up to fit within the image control, they actually scale past the height constraint such that you only see the middle of the image, with top and bottom cut off. Its as if the control only uses width when scaling, and forgets to check height?
Is this a bug in the Image control, or am I missing or mis-setting a property? To reproduce, find / create an image with a 'portrait' aspect ratio (taller than it is wide) and create an Image with Stretch="Uniform".
** UPDATE WITH REQUESTED XAML **** Note that the reason that the size is not explicit is to allow for full screen and scaling.
<Grid x:Name="LayoutRoot">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="9"/>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="9"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Border BorderBrush="Black" Grid.Row="0" Grid.ColumnSpan="8" BorderThickness="1, 1, 1, 0">
<Border BorderBrush="{StaticResource blackStatusMapLGB}" BorderThickness="9,9,9, 0">
<Border BorderBrush="Gray" BorderThickness="1, 1, 1, 0">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<MediaElement Height="Auto" Width="Auto" Visibility="Collapsed" AutoPlay="true" Stretch="Fill" MediaFailed="SilverlightMediaPlayer_MediaFailed" Name="previewMediaElement"/>
<Image Name="imagePreview" Stretch="Uniform"/>
</StackPanel>
</Border>
</Border>
</Border>