I'm working on a project where I have to draw on a panel with bitmap as a background, use a canvas to draw, but when the size of the panel begins to achieve for example 2000x2000 - 2100x2100, the program closes.
I attach an example. Click on the screen to increase the size of the panel 50x50.
Check the logs to find the error message. In this case it is probably an out of memory error. Large bitmaps (including bitmaps created for the canvas drawing) require a lot of memory.