I am trying to take the screenshot of a view using canvas api and noe I want to ignore a variable area and keep the rest of image. I have the coordinates (x(left),y(top) and (areatoignore width), (areatoignore height) ) of the variable area that I wanted to ignore while taking screenshot.How can I do that???
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(),
view.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.draw(canvas);
I am trying to modify the canvas after capturing as shown below but it does give the desired image.
canvas.clipRect(rectangle, Region.Op.DIFFERENCE);
canvas.save();
rectangle has the coordinates I want to ignore.