WP8中带圆角的MediaElement

时间:2015-11-05 07:01:03

标签: windows-phone-8 mediaelement

我喜欢在Windows Phone 8应用开发中为我的视频创建圆角。如何获得此功能?

我试过以下代码

<Border x:Name="border" BorderThickness="1" BorderBrush="#FF000000" CornerRadius="20" Padding="1"
    HorizontalAlignment="Center" VerticalAlignment="Center">
                <Grid>
                    <Border Name="mask" Background="Transparent" CornerRadius="{Binding ElementName=border, Path=CornerRadius}"/>
                    <Grid>
                        <Grid.OpacityMask>
                            <VideoBrush SourceName="{Binding ElementName=mask}"/>
                        </Grid.OpacityMask>
                        <MediaElement x:Name="Media" HorizontalAlignment="Left" Height="128" 
                      VerticalAlignment="Top" Width="236" Source="/Assets/Videos/empty.m4v"/>
                    </Grid>
                </Grid>
            </Border>

0 个答案:

没有答案