Forum Discussion
TheEndless
13 years agoRoku Guru
I believe the key is invalidating the bitmap and the region before creating the new one. In your code, you're creating a new bitmap without invalidating the previous one, so the memory from the previous bitmap is still going to be in use when you try creating the new one. You should also invalidate the region before creating the new bitmap, because it will hold the reference to the previous bitmap open, resulting in the same issue.
Add the following lines immediately after your "NewFile:" label and see if it helps:
Add the following lines immediately after your "NewFile:" label and see if it helps:
bigbm = invalid
backgroundRegion = invalid