clearing a canvas and getting the memory back

Darren69

Member
Licensed User
Longtime User
Hi,

I have a problem that I cant seem to resolve, i have a program that creates a rather large canvas (just below the limits of crashing due to insufficient memory) which is fine as I just e-mail it once its created, but how do I trash it after? it doesn't need to be displayed on the device, and is actually never visible to the user.

I would like to be able to destroy the canvas (which is drawn on a panel) so that it frees up the memory it used.

I have tried to reduce the size of the panel that the canvas is drawn on, but it has no effect even if I invalidate it.

any help would be greatly appreciated.

thanks

Darren
 

Darren69

Member
Licensed User
Longtime User
Not when the canvas is drawn no.

First I draw a huge canvas. Then its emailed. And then I am trying to create a PDF.

If I create the PDF first and then email it then draw the canvas all is well. But if I draw the canvas first I don't seem to have any memory left according to the logs when its time for PDF writer to do its conversion sub routine.

So I was wonderng if there was a way to remove the canvas from memory once I am done with it.
 
Upvote 0

Darren69

Member
Licensed User
Longtime User
thanks again Erel, though I think I am now a little confused, do I need to recreate my canvas all over again using the RSImageprocessing library?

I just upgraded to the V2.2 and was trying to see how I use the reflection library but was unable to figure that out either. Its not the bitmap I want to free up, but the whole panel containing the canvas.
 
Upvote 0
Top