Ceci est ce que j'ai essayé jusqu'à présent pour l'orientation et je suis confronté à un problème de potraitdown il montre l'image en haut deux choses que je veux faire sont l'orientation de la caméra par défaut première et deuxième Zoom et Zoom arrière avant de prendre l'imageUtilisation de canavas puis-je Zoomer et Zoomer sur l'appareil photo et j'ai aussi une erreur dans l'orientation de son application Windows Phone
J'ai écrit ce code dans XAML
<Canvas x:Name="viewfinderCanvas" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,10">
<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>
et ceci est pour l'orientation C#
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
{
if (cam != null)
{
if (e.Orientation == PageOrientation.LandscapeRight)
{
landscapeRightRotation = 180;
// Rotate for LandscapeRight orientation.
viewfinderBrush.RelativeTransform =
new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = landscapeRightRotation };
}
else if (e.Orientation == PageOrientation.PortraitUp)
{
landscapeRightRotation = -90;
viewfinderBrush.RelativeTransform =
new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = landscapeRightRotation };
}
else if (e.Orientation == PageOrientation.PortraitDown)
{
landscapeRightRotation = 0;
// Rotate for LandscapeRight orientation.
viewfinderBrush.RelativeTransform =
new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = landscapeRightRotation };
}
else
{
viewfinderBrush.RelativeTransform =
new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 0 };
}
}
viewfinderTransform.ScaleY = 0;
base.OnOrientationChanged(e);
}
Besoin d'aide pour obtenir l'orientation ou l'angle par défaut que l'appareil photo intégré a –