1

嗨,我想显示一个圆形图像,我可以这样做:

<Image Style="{StaticResource RoundedImageStyle}" Source="MyImage.jpg">
    <Image.Clip>
        <EllipseGeometry Center="50,50" RadiusX="50" RadiusY="50"/>
    </Image.Clip>
</Image>

我在这样的静态资源中设置样式

<phone:PhoneApplicationPage.Resources>      
    <Style TargetType="Image" x:Key="RoundedImageStyle">
        <Setter Property="Width" Value="100"/>
        <Setter Property="Height" Value="100"/>
    </Style>
</phone:PhoneApplicationPage.Resources>

有没有办法将 Image.Clip 属性也实现为静态资源?

这是我尝试过的,它给了我错误:值不在预期范围内

<phone:PhoneApplicationPage.Resources>
    <EllipseGeometry x:Key="TitleImageClip" Center="50,50" RadiusX="50" RadiusY="50"/>    
</phone:PhoneApplicationPage.Resources>
4

1 回答 1

0

我不相信 Clip 在那里得到支持。我验证这在 Silverlight 和 Windows 8.1 Preview 上的 Windows Store 应用程序中具有相同的行为。

罗布·卡普兰 [MSFT]

来源

于 2013-10-29T12:03:22.773 回答