I have a class where a photo is captured and Bitmap is stored in the ImageView
. In another class I got brush tool (canvas). If I create a new Bitmap in a second class I can draw on canvas but I can't draw on the captured image from the first class. How could I move the bitmap from first class to another?
Method of the first class of captured image
protected void onActivityResult (int requestCode, int resultCode, Intent data){
super.onActivityResult(requestCode, resultCode, data);
bitmap = (Bitmap) data.getExtras().get("data");
imageView.setImageBitmap(bitmap);
}
Method of the second class with the brush tool and empty canvas
public void init(DisplayMetrics metrics) {
int height = metrics.heightPixels;
int width = metrics.widthPixels;
mBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
mCanvas = new Canvas(mBitmap);
currentColor = DEFAULT_COLOR;
strokeWidth = BRUSH_SIZE;
}