[英]Showing video from front and back camera at the same time in Windows Phone
[英]Captured images from front-facing camera are rotated - Windows Phone 8
我做基本的Windows Phone应用程序。 我需要使用前置摄像头捕获照片。 预览还可以,但是捕获的phoho被旋转了(90°)。
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:
<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>
对不起我的英语不好...
尝试从页面中删除SupportedOrientation和Orientation并进行检查。 然后将旋转角度更改为90
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.