How drag and adjust the image in a imageView of android and then mask that imageview with another

How to perform an action in android according to which we can drag and adjust the image in image View of android and then apply masking to it. Below is my code for masking an image
public void mask(Bitmap original){
Bitmap mask = BitmapFactory.decodeResource(getResources(),R.drawable.full_mask);
Bitmap result = Bitmap.createBitmap(mask.getWidth(), mask.getHeight(), Config.ARGB_8888);
Canvas mCanvas = new Canvas(result);
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
mCanvas.drawBitmap(original, 0, 0, null);
mCanvas.drawBitmap(mask, 0, 0, paint);
paint.setXfermode(null);
view.setImageBitmap(result);
view.setScaleType(ScaleType.CENTER);
view.setBackgroundResource(R.drawable.overlay_outlines);
view.invalidate();
}
Anonymous User
Anonymous User
Asked yesterday

TIP: If it's not your answer to this question, please click "Leave a Comment" button under the question to communicate with the question owner.

Categories