I have an app which allows users to freehand draw over an image. I have achieved it by using canvas.drawPath(path, paint).
However, my problem is how to save the path, which the user just drew, as png in a app folder. Because a user might need to make a few freehand draws over the image, that user might want to delete one of the drawing block he made, so each of the freehand drawings should be displayed independently as a png image when the main image is reloaded. By doing this, I also need to know the most top left x and y to display the png over the image.
I thought there would be a method to convert the path to bitmap or to save the canvas only the part with coloured pixels. But after some research, I couldn't find any.
Can someone help please. Thank you in advance.