简体   繁体   English

旋转从前置摄像头捕获的图像-Windows Phone 8

[英]Captured images from front-facing camera are rotated - Windows Phone 8

I do basic Windows Phone application. 我做基本的Windows Phone应用程序。 I need capture photos by front facing camera. 我需要使用前置摄像头捕获照片。 Preview is OK, but captured phoho is rotated(90°). 预览还可以,但是捕获的phoho被旋转了(90°)。

CS: CS:

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        if (PhotoCamera.IsCameraTypeSupported(CameraType.FrontFacing) == true)
        {            
            cam = new PhotoCamera(CameraType.FrontFacing);
            cam.CaptureImageAvailable += new EventHandler<Microsoft.Devices.ContentReadyEventArgs>(cam_CaptureImageAvailable);
            viewfinderBrush.SetSource(cam);               
        }
        else
        {
            txtMessage.Text = "No front camera";
        }
    }

XAML: XAML:

<Canvas x:Name="viewfinderCanvas" Height="640" Width="480" Tap="viewfinder_Tapped" Margin="0,138,0,46" Grid.RowSpan="2">
        <Canvas.Background>
            <VideoBrush x:Name="viewfinderBrush">
                <VideoBrush.RelativeTransform>
                    <CompositeTransform
                        x:Name="viewfinderTransform"
                        CenterX="0.5"
                        CenterY="0.5"
                        Rotation="-90"/>
                </VideoBrush.RelativeTransform>
            </VideoBrush>
        </Canvas.Background>
    </Canvas>

Sorry for my English... 对不起我的英语不好...

Try Removing the SupportedOrientations and Orientation from the page and check. 尝试从页面中删除SupportedOrientation和Orientation并进行检查。 then changing the rotation to 90 然后将旋转角度更改为90

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Windows Phone中同时显示来自前置和后置摄像头的视频 - Showing video from front and back camera at the same time in Windows Phone 我的手机有前置摄像头和/或麦克风吗? - Does my phone have a front facing camera AND / OR a microphone? Windows Phone 8.1:如何更改前置摄像头的旋转角度? - Windows Phone 8.1: how to change front camera rotation? 尝试在Windows Phone上显示相机胶卷中的图像时出现跨线程异常 - Cross Thread Exception when trying to display Images from Camera Roll on Windows Phone Windows Phone 8.1 - 尝试从相机胶卷获取缩略图图像时性能不佳 - Windows Phone 8.1 - Bad performance when trying to get Thumbnail images from Camera Roll Unity Android前置摄像头WTF bug - Unity Android front facing Camera WTF bug WebBrowser没有在Windows Phone中捕获 - WebBrowser not getting captured in windows phone 尝试使用后置摄像头,然后使用前置摄像头C#MediaCapture Windows Phone 8.1 - Trying to use back camera followed by front camera c# mediacapture windows phone 8.1 Windows Phone 7合并从摄像机录制的视频 - Windows Phone 7 Merge Videos recorded from camera 从Windows Phone 10上的FileOpenPicker访问摄像头 - Access camera from FileOpenPicker on Windows Phone 10
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM