Refer to the links:
How to create a circular ImageView in Android?
How to make ImageView with rounded corners?
The above code works for native android. You need to configure the code to convert to C # syntax and accept for xamarin android. For your convenience, I changed the code to C #.
public class ImageHelper { public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int pixels) { Bitmap output = Bitmap.CreateBitmap(bitmap.Width, bitmap.Height , Android.Graphics.Bitmap.Config.Argb8888); Canvas canvas = new Canvas(output); Color color = Color.DodgerBlue; Paint paint = new Paint(); Rect rect = new Rect(0, 0, bitmap.Width, bitmap.Height); RectF rectF = new RectF(rect); float roundPx = pixels; paint.AntiAlias = true; canvas.DrawARGB(0, 0, 0, 0); paint.Color = color; canvas.DrawRoundRect(rectF, roundPx, roundPx, paint); paint.SetXfermode(new PorterDuffXfermode(Android.Graphics.PorterDuff.Mode.SrcIn)); canvas.DrawBitmap(bitmap, rect, rect, paint); return output; }
source share