GcCollect and GetTotalMemory are added to BitmapEx. These are intended for possible diagnostic use and should not be required in normal use.
As you mention this I have a question about memory handling and BitMapEx objects.
I'm currently writing an OpenStreetMap Mapviewer program for the device. OpenStreetMap Maps are generated from tiles with 256x256 pixels. For displaying the complete map I have to load several tiles and put them on an image. In the first version this was done with two BitMapEx objects. One for the tile (bmpTile) and another (bigger) for the map (bmpImage) which will be displayed.
The tiles were loaded with bmpTile.New1(filename) and then copied to the correct position on bmpImage with a DrawerEx Object with drwImage.DrawImage(bmpTile.Value, ...).
The problem with this solution was that when scrolling around, many tiles are loaded with bmpTile.New1() method and I get an OutOfMemory exception very soon.
I looked into the source of ImageLibEx and I don't understand why I get the OutOfMemory Exception because when the New1() Method is called the old bitmap gets disposed and a new one is created.
Is the GarbageCollector too slow in freeing the not used memory or is there somewhere a memory leak?
Currently I use a ControlsExDevice/NativeImage for Loading the tiles with nImgTile.LoadPicture(filename). This works well and I have no OutOfMemory exceptions any more.
As a conclusion BitMapEx.New1() method called several times on the same objects seems to eat up memory but I don't understand why. Perhaps I should try it again with calling GcCollect after calling bmpTile.New1() method.
Greetings,
Markus