Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting Camera to work well in Portrait mode
    primarykey
    data
    text
    <p>I added camera to an my App which is all in Portrait mode so would like the to keep it this way.</p> <p>Here is the relevant code snippets I use in my .XAML</p> <pre><code>SupportedOrientations="Portrait" Orientation="Portrait" mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480" &lt;Canvas x:Name="viewfinderCanvas" Width="480" Height="800" &gt; &lt;!--Camera viewfinder --&gt; &lt;Canvas.Background&gt; &lt;VideoBrush x:Name="viewfinderBrush"&gt; &lt;/VideoBrush&gt; &lt;/Canvas.Background&gt; &lt;/Canvas&gt; </code></pre> <p>Here is my setup code from the .XAML.CS</p> <pre><code> protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { if (PhotoCamera.IsCameraTypeSupported(CameraType.FrontFacing)) { cam = new Microsoft.Devices.PhotoCamera(CameraType.FrontFacing); } else { cam = new Microsoft.Devices.PhotoCamera(CameraType.Primary); } cam.Initialized += new EventHandler&lt;Microsoft.Devices.CameraOperationCompletedEventArgs&gt;(cam_Initialized); cam.CaptureCompleted += new EventHandler&lt;CameraOperationCompletedEventArgs&gt;(cam_CaptureCompleted); cam.CaptureImageAvailable += new EventHandler&lt;Microsoft.Devices.ContentReadyEventArgs&gt;(cam_CaptureImageAvailable); cam.CaptureThumbnailAvailable += new EventHandler&lt;ContentReadyEventArgs&gt;(cam_CaptureThumbnailAvailable); viewfinderBrush.SetSource(cam); } </code></pre> <p>The problem is that I hold the phone in Portrait and point the phone at a person. The screen shows the persons head on the right side of the screen and the persons feet at the left of the screen. While as they stand in front of me there head should be at the top of the screen and there feet at the bottm, cause these people aint superman.</p> <p>So it seems the image from the camera is getting rotated -90 before it appears on the screen.</p> <p>Can anybody explain whats going wrong and what sample code I need to implement to fix this problem.</p> <p>Thanks, -Code</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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