I know how to draw paths on a canvas and understand how to undo/redo. But now I want to draw shapes (lines, circles, rectangles) that dynamically resize depending on how I drag them – just like we have in MS Paint.
If I use “drawLine”, the line is there permanently with no way of erasing it and redrawing it to my new finger location. Same with circle as I want the circle to constantly change width as I drag my finger. So the old one has to erased (keeping all the other paths on the bitmap intact) and the new one drawn in its place.
Been searching a lot for this, but haven’t come across how t do it. Maybe I’m using the wrong keywords, but I don’t know. Any pointers?
Managed to do it. I misunderstood the way the offscreen drawing thing worked. The idea is to write to the bitmap only after you have the shape you want – ie on “touch up”. Till then, draw the shape using the “canvas” object in on Draw…