I do not know much about the programming in android studio but now I have to subtract an image selected by the user in an imageview and convert it into a bitmap to be able to modify the colors of the image through the paint class, the problem is that when you convert the imageView to bitmap and try to put this in a canvas to modify it as the user selects color, in the conversion the application is dropped, this is the code with which I tried it:
imagen = (ImageView) findViewById(R.id.imagetest);
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(8);
paint.setColor(Color.BLACK);
imagen.buildDrawingCache();
Bitmap bitmap = imagen.getDrawingCache();
Matrix matrix = imagen.getImageMatrix();
canvas.drawBitmap(bitmap, ima.getImageMatrix(), paint)