Name
moai.FreeImage -- free image in cache (V1.2)
Synopsis
moai.FreeImage(id[, isicon])
Function
This function can be used to free an image in RapaGUI's internal cache. You have to pass the identifier of the image that should be freed in id. If the optional isicon argument is set to True, id must be the identifier of a Hollywood icon to free. Otherwise, id must be the identifier of a Hollywood brush that should be freed. Alternatively, you can also pass -1 in id to free all images in RapaGUI's internal cache.

You must make sure that the specified image is no longer used by any widgets in your GUI before you call this function. Note that under normal conditions it is not necessary to call this function because normally all cached images are freed automatically by RapaGUI. Under certain conditions, however, it can be useful to call this function.

RapaGUI caches all images that you use in your GUI. That is why when you try to use a certain image in your GUI a second time, it will just be loaded from RapaGUI's internal image cache for performance reasons. This can lead to unwanted behaviour in case you have updated your image's graphics in the meantime and you want RapaGUI to use the updated graphics. In that case, you first have to free the image in RapaGUI's internal image cache by using this function. When you pass the image to RapaGUI again then, it will be re-created from the image's current contents and it will be cached anew. For listview and treeview widgets, you can also use moai.UpdateImage() to update the graphics data of an image.

See Image cache for details.

Inputs
id
identifier of image to free or -1 to free all images
isicon
optional: True if id contains the identifier of an icon, False if it contains the identifier of a brush (defaults to False) (V2.0)

Show TOC