title: Adapting a camera app to the screen rotation - windows phone RT
body: <p>I am creating a camera app using MediaCapture. I am trying to adapt to screen rotation and thus I have created the following method:</p>
  
  <pre><code>        private void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
      {
          width = Window.Current.Bounds.Width;
          height = Window.Current.Bounds.Height;
          //captureManager.SetPreviewRotation(VideoRotation.Clockwise90Degrees);
          //if (ApplicationView.GetForCurrentView().Orientation.ToString() == "Portrait") capturePreview.Stretch = Stretch.Fill;
          capturePreview.Width = width;
          capturePreview.Height = height;
          imagePreview.Width = width;
          imagePreview.Height = height;
          //if (ApplicationView.GetForCurrentView().Orientation.ToString() == "Portrait") capturePreview.Stretch = Stretch.Fill;
          //else capturePreview.Stretch = Stretch.Uniform;
      }
  </code></pre>
  
  <p>When I open my app the camera fills the whole page but when I flip the camera the capturePreview only takes half of the page, It doesn't matter if I start the app in portrait or horizontal mode, the other mode won't work but the first mode will also if flipped in to.</p>
  
  <p>Another question is about the actual capturePreview layout, I found that if I keep the screen at horizontal layout the camera works great but if the device is in portrait mode I cant fill the whole page without stretching the photo, is there a way to keep only one element on the screen in a certain rotation (capturePreview) I tried rotating it with a rotation tranform but that also affects the actual place of the element.
  Thank you</p>