C# 将VideoBrush保存到图像后的照片方向
我在肖像定位上拍照有问题。 我在画布上使用VideoBrush。背景:C# 将VideoBrush保存到图像后的照片方向,c#,silverlight,windows-phone-7,windows-phone-8,windows-phone,C#,Silverlight,Windows Phone 7,Windows Phone 8,Windows Phone,我在肖像定位上拍照有问题。 我在画布上使用VideoBrush。背景: <Grid x:Name="ContentPanel" Grid.Row="0" Margin="12,0,12,0"> <Canvas Name="PhotoCanvas" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="1"> <Canvas.Backgr
<Grid x:Name="ContentPanel" Grid.Row="0" Margin="12,0,12,0">
<Canvas Name="PhotoCanvas" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="1">
<Canvas.Background>
<VideoBrush x:Name="viewCamera">
<VideoBrush.RelativeTransform>
<CompositeTransform x:Name="cameraViewTransform" CenterX=".5" CenterY=".5"/>
</VideoBrush.RelativeTransform>
</VideoBrush>
</Canvas.Background>
<Image Name="photoImage"></Image>
</Canvas>
</Grid>
但我看到保存后的横向照片
可能是我的定位代码吗
switch (orientation)
{
case PageOrientation.Landscape:
case PageOrientation.LandscapeLeft:
cameraViewTransform.Rotation = 0;
break;
case PageOrientation.LandscapeRight:
cameraViewTransform.Rotation = 180;
break;
case PageOrientation.Portrait:
case PageOrientation.PortraitUp:
cameraViewTransform.Rotation = 90;
break;
case PageOrientation.PortraitDown:
cameraViewTransform.Rotation = 270;
break;
}
}
如何解决这个问题?
谢谢大家! 您是否正在使用光电捕获设备?尝试:
captureDevice.SetProperty(KnownCameraGeneralProperties.EncodeWithOrientation,
摄像转换。你的定位)代码>我不使用光电捕获设备。如何使用它?我使用PhotoCamera和PhotoCamera。CaptureImageAvailable我无法用PhotoCamera解决问题,现在我正在重写代码使用PhotoCaptureDevice
switch (orientation)
{
case PageOrientation.Landscape:
case PageOrientation.LandscapeLeft:
cameraViewTransform.Rotation = 0;
break;
case PageOrientation.LandscapeRight:
cameraViewTransform.Rotation = 180;
break;
case PageOrientation.Portrait:
case PageOrientation.PortraitUp:
cameraViewTransform.Rotation = 90;
break;
case PageOrientation.PortraitDown:
cameraViewTransform.Rotation = 270;
break;
}
}