WPF椭圆与BackgroundColor中和图像 [英] WPF Ellipse with BackgroundColor and Image

查看:312
本文介绍了WPF椭圆与BackgroundColor中和图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Windows Phone应用程序和我有一些椭圆。是否有可能对他们有背景图像和背景颜色?

I'm developing a Windows Phone application and I have some Ellipses. Is it possible to have a background image on them AND a background color?

当我看着它,VS只允许我Fill属性与图像改变,但没。'T让我保持颜色的填充+图像

When I looked for it, VS only allows me to change the Fill property with an image but didn't allow me to keep the Color on Fill + the Image.

推荐答案

只要使用两个椭圆,相互重叠的:

Just use two ellipses, overlapping each other:

<Grid>
    <Ellipse Width="100" Height="60" Fill="Navy" />
    <Ellipse Width="100" Height="60">
        <Ellipse.Fill>
            <RadialGradientBrush>
                <GradientStop Color="#00FF0000" Offset="0" />
                <GradientStop Color="#FFFF0000" Offset="1" />
            </RadialGradientBrush>
        </Ellipse.Fill>
    </Ellipse>
</Grid>

更改第二的填充属性来使用你的形象。

Change the fill property of the second to use your image.

这篇关于WPF椭圆与BackgroundColor中和图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆