我做基本的Windows Phone应用程序。我需要通过前置摄像头拍摄照片。 预览没问题,但拍摄的光照旋转了(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>
抱歉我的英文......
答案 0 :(得分:0)
尝试从页面中删除SupportedOrientations和Orientation并检查。然后将旋转更改为90