tags:

views:

34

answers:

1

Hi,

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 the empty space is transparent. I couldn't find a way to fill it with some other color. Any ideas how to achieve that?

A: 

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?

Alex Humphrey
yes i do need to see the entire image. i also thought of that but it is really nasty..
serine