title: Using Image Control with Stretch = UniformToFill - WP7
body: <p>I have an image placed on a Page as follow </p>
  
  <pre><code>&lt;Grid x:Name="LayoutRoot" Background="Transparent"&gt;
     &lt;Grid.RowDefinitions&gt;
       &lt;RowDefinition Height="Auto"/&gt;
       &lt;RowDefinition Height="*"/&gt;
     &lt;/Grid.RowDefinitions&gt;
  
  &lt;Image Name="im" Source="/images/hqdefault.jpg" Height="250" Stretch="UniformToFill"  VerticalAlignment="Center"/&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p>this is the whole page XAML, image can be downloaded from <a href="http://i.ytimg.com/vi/wNKKCHv-oOw/hqdefault.jpg" rel="nofollow">http://i.ytimg.com/vi/wNKKCHv-oOw/hqdefault.jpg</a></p>
  
  <p>Code behind contains some logic to handle the PageOrientation_Change </p>
  
  <pre><code> private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
   {
      if (Orientation == PageOrientation.Landscape ||
          Orientation == PageOrientation.LandscapeLeft ||
          Orientation == PageOrientation.LandscapeRight)
      {
         im.Height = Application.Current.Host.Content.ActualWidth;
         im.Width = Application.Current.Host.Content.ActualHeight;
  
         im.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
         im.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
       }
       else
       {
         im.Height = 250;
         im.Width = Application.Current.Host.Content.ActualWidth;
       }
    }
  </code></pre>
  
  <p>If some one may try this he/she may find that StrechToFill crops the content of the image from bottom where as I am expecting it to crop it from top and bottom equally and keep the image content centered within image control.</p>
  
  <p>HOpe I have made myself clear if not please consider making a sample from provided code. Thanks a lot.</p>