BBjImageManager::setCacheSize
Description
In BBj 7.0 and higher, this method sets the size of the BBjImageManager's internal cache of images.
Syntax
Return Value |
Method |
void |
setCacheSize(int size) |
Parameters
Variable |
Description |
size |
The number of images to keep in memory. |
Return Value
None.
Remarks
The default cache size is 32. Passing the argument '0' will prevent any images from being cached. If a program loads the same image from a file name multiple times, the bytes will be transferred to the ThinClient multiple times as well, and the ThinClient will maintain multiple references to that image.
Each interpreter maintains its own image cache. It may be necessary to reduce the cache size if large images are used.
This method only applies to programs that invoke BBjImageManager::loadImageFromFile() or that specify the "BITMAP=file.bmp" syntax in when setting the button text. If a program instead maintains a reference to a BBjImage object and subsequently uses that BBjImage in multiple controls (e.g., BBjButton::setImage() and BBjTabCtrl::setImageAt() ), the bytes for that BBjImage are only transferred to the ThinClient once.
To clear the current cache of images, use the following code:
oldCacheSize = imgMgr!.getCacheSize()
imgMgr!.setCacheSize(0)
imgMgr!.setCacheSize(oldCacheSize)
Example
|
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.