Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><em>Adding more clarification to the answer</em>: One thing the documentation describes that isn't mentioned here is that the relative transform is adjusted in the OnOrientationChanged event. Another difference is that the relative transform isn't specified in the XAML. </p> <p>In the docs (<a href="http://msdn.microsoft.com/en-us/library/hh202956%28v=VS.92%29.aspx" rel="nofollow">How to: Create a Base Camera Application for Windows Phone</a>), the rectangle is filled with the videobrush as follows:</p> <pre><code>&lt;!--Camera viewfinder &gt;--&gt; &lt;Rectangle Width="640" Height="480" HorizontalAlignment="Left" x:Name="viewfinderContainer"&gt; &lt;Rectangle.Fill&gt; &lt;VideoBrush x:Name="viewfinderBrush" /&gt; &lt;/Rectangle.Fill&gt; &lt;/Rectangle&gt; </code></pre> <p>Then, in the code-behind, the OnOrientationChanged event rotates the rectangle based on orientation:</p> <pre><code> // Ensure that the viewfinder is upright in LandscapeRight. protected override void OnOrientationChanged(OrientationChangedEventArgs e) { if (e.Orientation == PageOrientation.LandscapeRight) { viewfinderBrush.RelativeTransform = new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 180 }; } else { viewfinderBrush.RelativeTransform = new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 0 }; } base.OnOrientationChanged(e); } </code></pre> <p>The code in this topic (which corresponds to the sample) is configured to only use landscape orientation, maybe this is why you're only getting landscape images(?) At the beginning, the following attributes are added to the phone:PhoneApplicationPage element in MainPage.xaml:</p> <pre><code>SupportedOrientations="Landscape" Orientation="LandscapeLeft" </code></pre> <p>If you are still getting images orientated incorrectly, sync your images to your PC and see if they're oriented correctly while viewing them there (on your PC). It could be a bug with the Beta that is causing the image to not appear correctly on the device.</p> <p>Hope that helps. Cheers</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload