I'm currently using this code:
@Override
public Bitmap transform(Bitmap source) {
Bitmap result = Bitmap.createBitmap(source.getWidth(), source.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(result);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, source.getWidth(),source.getHeight());
final RectF rectF = new RectF(rect);
final float scale = context.getResources().getDisplayMetrics().density;
final float roundDp = 10 * scale;
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawRoundRect(rectF, roundDp, roundDp, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(source, rect, rect, paint);
source.recycle();
return result;
}
But the problem is that this method only allows me to modify all 4 corners at once. How would I round only the bottom corners of the image?