开发者

Ellipse default Fill color

I use an ImageBrush to fill an Ellipse.

<ImageBrush Stretch="Uniform" ImageSource="{Binding Image}" />

Since I use uniform stretching my image doesn't fill the whole area of the ellipse and th开发者_如何学JAVAe empty space is transparent. I couldn't find a way to fill it with some other color. Any ideas how to achieve that?


I can't think of a nice way to do this. You could simply draw an Ellipse underneath using a SolidColorBrush and have an Ellipse using an ImageBrush on top of it, something like:

<Grid>
  <Ellipse Fill="Red" />
  <Ellipse>
    <Ellipse.Fill>
      <ImageBrush Stretch="Uniform" ImageSource="{Binding Image}" />
    </Ellipse.Fill>
  </Ellipse>
</Grid>

...but that's pretty nasty. Is there a reason why a Stretch property value of UniformToFill won't work? Do you definately need to see the entire image at all times?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜