WPF Ellipse with BackgroundColor and Image

I am developing a Windows Phone application and I have several ellipses. Is it possible to have a background image on them AND the background color?

When I searched for it, VS only allowed me to change the Fill property with the image, but it did not allow me to keep the color on the fill + image.

+4
source share
2 answers

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.

+9
source

try the following:

 <Ellipse> <Ellipse.Fill> <ImageBrush ImageSource="/myimage.png" Stretch="Fill"></ImageBrush> </Ellipse.Fill> </Ellipse> 
+2
source

Source: https://habr.com/ru/post/1443437/


All Articles