Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to make a squared image to a round image on xamarin forms ?

SJ-87SJ-87 USUniversity ✭✭

Is it possible to make a round image on Xamarin Forms of a squared image. I have a lot of images which should be displayed as a circle on ListView along with its name etc. But how can I do this?


<Ellipse.Fill>

</Ellipse.Fill>

I tried like this, but it is not working and it threw an error "Type ImageBrush not found in xmlns http://xamarin.com/schemas/2014/forms"

Best Answer

Answers

  • SJ-87SJ-87 USUniversity ✭✭
  • AmayindiLynnAmayindiLynn USMember ✭✭

    Check out Xam.Plugins.Forms.ImageCircle

  • Tam66662Tam66662 Member

    @Koboki Your answer keeps the Image "square" inside of the round Frame. I tried setting both the Frame and the Image's HorizontalOptions and VerticalOptions to "FillAndExpand", and also tried setting the Image's Aspect to "AspectFill" and "Fill", but nothing worked. Is there a way to fill the image inside of the available space of the round Frame?

  • Kcops11Kcops11 Member
    edited June 29

    I know this post is really old but just in case anyone else comes here looking for an answer @Koboki solution will work you just need to make sure that your frame padding is set to 0. Here is an example from my current project:

            <Frame x:Name="userFrame" HasShadow="False" WidthRequest="128" HeightRequest="128" CornerRadius="64" 
                  Padding="0">
               <Image x:Name="userAV" Source="{DynamicResource currentAVI}"/>
            </Frame>
    

    Result :

Sign In or Register to comment.