Moving part of the canvas Android

85 views Asked by At

I've attached the code I'm using:

    @Override
public void MaskImageByCase(Bitmap mask,Bitmap overlay,Bitmap originalImage,ImageView caseContainer) {
    Bitmap result = Bitmap.createBitmap(mask.getWidth(), mask.getHeight(), Bitmap.Config.ARGB_8888);
    Canvas mCanvas = new Canvas(result);
    Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
    paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
    Bitmap scaledImg = Bitmap.createScaledBitmap(originalImage, mask.getWidth(), mask.getHeight(), false);
    mCanvas.drawBitmap(scaledImg, 0, 0, null);
    mCanvas.drawBitmap(mask, 0, 0, paint);
    paint.setXfermode(null);
    caseContainer.setScaleType(ImageView.ScaleType.CENTER);
    result = overlay(result,overlay);
    caseContainer.setScaleType(ImageView.ScaleType.FIT_XY);
    caseContainer.setImageBitmap(result);

}

I want to enable gestures like pinch, zoom and drag only on the originalImage bitmap. How can I achieve this kind of behaviour?

0

There are 0 answers