Prima::StdBitmap - shared access to the standard bitmaps
The toolkit provides the sysimage.gif file that contains the standard Prima image library and consists of a predefined set of images used by different modules. To provide unified access to the images inside the file, this module's API can be used. Every image is assigned to a sbmp:: constant that is used as an index for an image loading request. If an image is loaded successfully, the result is cached and the successive requests use the cached image.
The images can be loaded as Prima::Image and Prima::Icon instances, by two methods, correspondingly image and icon.
my $logo = Prima::StdBitmap::icon( sbmp::Logo );
Loads the INDEXth image frame and returns a Prima::Icon instance.
Loads the INDEXth image frame and returns a Prima::Image instance.
Loads the indexth image frame from file and returns it as either a Prima::Image or a Prima::Icon instance, depending on the value of the boolean icon flag. If the copy boolean flag is unset, a cached image can be used. If this flag is set, a cached image is never used and the created image is neither stored in the cache. Since the module's intended use is to provide shared and read-only access to the image library, copy set to 1 can be used to return non-shareable images.
The loader automatically scales images if the system dpi suggests so. If layering is supported, the icon scaling will use that as well. To disable these optimizations use the raw => 1 flag to disable all optimizations, and argb => 0 to disable producing ARGB icons.
raw => 1
argb => 0
An index value passed to the methods must be one of the sbmp:: constants:
The $sysimage scalar is initialized to the file name to be used as a source of standard images. It is possible to alter this scalar at run-time, which causes all subsequent image frame requests to be redirected to the new file.
The loading routine scales and visually enhances the images automatically according to the system settings that are reported by the Prima::Application class. It is therefore advisable to load images after the Application object is created.
Dmitry Karasik, <firstname.lastname@example.org>.
Prima, Prima::Image, Prima::Const.
To install Prima, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.