TomDuncan Active Member Licensed User Longtime User Jan 7, 2023 #1 Hi all, how do you clear a bitmapcreator? My initial thought was to reinitialise it but I think I am getting an error after a while. If I'd dim one in a subroutine is it freed on exit from the routine? Tom
Hi all, how do you clear a bitmapcreator? My initial thought was to reinitialise it but I think I am getting an error after a while. If I'd dim one in a subroutine is it freed on exit from the routine? Tom
E emexes Expert Licensed User Longtime User Jan 7, 2023 #2 TomDuncan said: If I'd dim one in a subroutine is it freed on exit from the routine? Click to expand... It's not freed immediately on exit from the routine; it's more left unused and unreferenced by the side of the road and eventually the garbage collecter frees it for you, either when things are quiet or when memory supply runs low. Upvote 0
TomDuncan said: If I'd dim one in a subroutine is it freed on exit from the routine? Click to expand... It's not freed immediately on exit from the routine; it's more left unused and unreferenced by the side of the road and eventually the garbage collecter frees it for you, either when things are quiet or when memory supply runs low.
TomDuncan Active Member Licensed User Longtime User Jan 7, 2023 #3 So if I dim the bitmapcreator in the globals section, can I then Initialize it every time I want to use it? Upvote 0
So if I dim the bitmapcreator in the globals section, can I then Initialize it every time I want to use it?
E emexes Expert Licensed User Longtime User Jan 7, 2023 #4 TomDuncan said: So if I dim the bitmapcreator in the globals section, can I then Initialize it every time I want to use it? Click to expand... Lol I did wonder if maybe it was a global even though your mention of Dimming it in a Sub made it sound like a local variable. If it is a global, then initializing it after you've finished using it should cause it to lose hold of any memory that it previously had allocated to it, and that now-unreferenced memory will eventually be gathered up by the garbage collector for reuse. (Re-)initializing a Bitmap Creator object will probably also cause it to allocate some new memory, but I would except that to be fairly small if you stipulated new dimensions of eg 1 x 1. Last edited: Jan 7, 2023 Upvote 0
TomDuncan said: So if I dim the bitmapcreator in the globals section, can I then Initialize it every time I want to use it? Click to expand... Lol I did wonder if maybe it was a global even though your mention of Dimming it in a Sub made it sound like a local variable. If it is a global, then initializing it after you've finished using it should cause it to lose hold of any memory that it previously had allocated to it, and that now-unreferenced memory will eventually be gathered up by the garbage collector for reuse. (Re-)initializing a Bitmap Creator object will probably also cause it to allocate some new memory, but I would except that to be fairly small if you stipulated new dimensions of eg 1 x 1.
TomDuncan Active Member Licensed User Longtime User Jan 7, 2023 #5 I had it dimmed in a sub but thought of the global dim. Is their an easy way to just clear the bitmap so I can create it without prior image in the bitmap? Seemed like an easy idea but old fellow cannot see how. lol Upvote 0
I had it dimmed in a sub but thought of the global dim. Is their an easy way to just clear the bitmap so I can create it without prior image in the bitmap? Seemed like an easy idea but old fellow cannot see how. lol
kimstudio Active Member Licensed User Longtime User Jan 7, 2023 #6 If I understand your requirement correctly: just use Bc.DrawRect() to draw any color you want for the whole bitmap. Upvote 1
If I understand your requirement correctly: just use Bc.DrawRect() to draw any color you want for the whole bitmap.