我在这里和不同的门户网站上进行了几次问答,但无法正常工作...我的页面方向是纵向...
<Rectangle x:Name="videoRectangle" Margin="0,0,0,0">
<Rectangle.Fill>
<VideoBrush x:Name="viewfinderBrush" AlignmentX="Left" AlignmentY="Top" Stretch="UniformToFill">
<VideoBrush.RelativeTransform>
<CompositeTransform x:Name="videoBrushTransform" CenterX="0.5" CenterY="0.5" />
</VideoBrush.RelativeTransform>
</VideoBrush>
</Rectangle.Fill>
</Rectangle>
ARPage_OrientationChanged 背后的代码永远不会被调用
public ARPage()
{
InitializeComponent();
this.OrientationChanged += ARPage_OrientationChanged;
}
void ARPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
{
abc.Text = e.Orientation.ToString();
switch (e.Orientation)
{
case PageOrientation.Landscape:
case PageOrientation.LandscapeLeft:
videoBrushTransform.Rotation = 0;
break;
case PageOrientation.LandscapeRight:
videoBrushTransform.Rotation = -45;
break;
case PageOrientation.Portrait:
case PageOrientation.PortraitUp:
videoBrushTransform.Rotation = -270;
break;
case PageOrientation.PortraitDown:
videoBrushTransform.Rotation = -90;
break;
}
}
视频画笔始终以横向模式显示视频...
我做错了什么