1

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?

serine
  • 1,338
  • 14
  • 24

1 Answers1

0

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
  • 6,099
  • 4
  • 26
  • 41