簡體   English   中英

如何調整視頻畫筆的寬高比

[英]How to adjust the videobrush aspect ratio

盡管我注意到縱向模式下的縱橫比與橫向模式下的不同,但我仍嘗試在應用程序中放置視頻刷。 我如何調整此設置,以使videorbush保持默認縱橫比,而與手機的旋轉情況無關?

MainPage.xaml

<Rectangle x:Name="videoRectangle" Grid.Row="0" Grid.ColumnSpan="2" >
            <Rectangle.Fill>
                <VideoBrush  x:Name="viewfinderBrush">
                    <VideoBrush.RelativeTransform>
                        <!--<CompositeTransform x:Name="viewfinderBrushTransform" CenterX=".5" CenterY=".5" Rotation="90" />-->
                        <CompositeTransform x:Name="viewfinderBrushTransform" CenterX=".5" CenterY=".5"  />
                    </VideoBrush.RelativeTransform>
                </VideoBrush>
            </Rectangle.Fill>
</Rectangle>

MainPage.xaml.cs

..do adjustments in code behind?

注意,我設置了SupportedOrientations="Portrait"

您所需要做的就是根據設備的方向將Brush.RelativeTransform屬性設置為CompositeTransform

檢查該示例並在代碼上搜索“ OnOrientationChanged”,以了解您需要在應用中執行的操作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM