I'd like to create an empty bitmap and set a canvas to that bitmap and then draw any shape on the bitmap.
You can do a check when you want to return the BitMap look to see if the ArrayList of Paths is bigger than 0 and return the BitMap if so, or else return null.
Canvas is the place or medium where perfroms/executes the operation of drawing, and Bitmap is responsible for storing the pixel of the picture you draw.
This is probably simpler than you're thinking:
int w = WIDTH_PX, h = HEIGHT_PX; Bitmap.Config conf = Bitmap.Config.ARGB_8888; // see other conf types Bitmap bmp = Bitmap.createBitmap(w, h, conf); // this creates a MUTABLE bitmap Canvas canvas = new Canvas(bmp); // ready to draw on that bitmap through that canvas
Here's a series of tutorials I've found on the topic: Drawing with Canvas Series
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With