Loading of big images takes very long time

Description:

In general the bitmap resources are stored in compressed format and need to be uncompressed and loaded into the RAM when they are used. The bigger the bitmap is the longer this loading time will take. The loading time depends as well strongly on the memory and bus performance of the target platform. As long as the resource is referenced from an object, it will not be released by the garbage collector. Once the bitmap was reclaimed by the garbage collector, it takes the same time to show it again.

 

Solution:

To avoid long loading time at the moment you want to show the image on the screen, you can load the image in advance and hold it invisible in the background. Just assign the bitmap resource to a dummy object Views::Image in your application class and set the property "Visible" of this image to "false". In this case the bitmap will be loaded at the moment when your application class is created. Then the bitmap remains loaded in the RAM because it is referenced from the application object. This costs permanently memory but saves the loading time when the image gets displayed.

 

See also:

 

Keywords:

Image, Bitmap, resources, PNG, BMP, GIF, JPG, big, slow, long

 

Last update on 2010-08-19 by Mario Stefanutti.

Go back