Search code examples
xamlwindows-phone-8

How to make a squared image to a round image on Windows Phone


Is it possible to make a round image from a squared image on a Windows phone? I have a lot of images which should be displayed as a circle. But how can I do this?


Solution

  • In XAML you want to make the circle using an Ellipse control. Then give it an ImageBrush fill.

    <Ellipse Height="100" Width="100">
        <Ellipse.Fill>
            <ImageBrush ImageSource="YourImage.png"/>
        </Ellipse.Fill>
    </Ellipse>