1

I'm trying to convert my ImageView into a RoundedRectangle. I have this code:

bitmap = holder.profile_image.getDrawingCache();
Bitmap MutableBitmap = bitmap.copy(Bitmap.Config.ARGB_8888,true);
holder.profile_image.setDrawingCacheEnabled(false);
Canvas canvas = new Canvas(MutableBitmap);

Paint paint = new Paint();

RectF rectF = new RectF(0,0,90,100);

paint.setAntiAlias(true);

canvas.drawRoundRect(rectF,5,5,paint);

//This sets the ImageView
holder.profile_image.setImageBitmap(MutableBitmap);

The issue is that it only seems to DRAW a Rounded Rectangle on top of my Image instead of converting my image into a Rounded Rectangle. How can i fix it so that it converts my bitmap into a Rounded Rectangle shape?

0 Answers0