Bitmap image = BitmapFactory.decodeResource(context.getResources(), R.drawable.image);
int width = image.getWidth();
int height = image.getHeight();
int w = 100;
int h = 100;
Bitmap clipArea = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(clipArea);
c.drawRoundRect(new RectF(0, 0, w, h), 10, 10, new Paint(Paint.ANTI_ALIAS_FLAG));
Bitmap newImage = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(newImage);
Paint paint = new Paint();
canvas.drawBitmap(clipArea, 0, 0, paint);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
canvas.drawBitmap(image, new Rect(0, 0, width, height), new Rect(0, 0, w, h), paint);
ImageView imageView = (ImageView)context.findViewById(R.id.imageview);
imageView.setImageDrawable(new BitmapDrawable(newImage));