1Prima::StdBitmap(3) User Contributed Perl Documentation Prima::StdBitmap(3)
2
3
4
6 Prima::StdBitmap - shared access to the standard toolkit bitmaps
7
9 The toolkit contains sysimage.gif image library, which consists of a
10 predefined set of images, used in several toolkit modules. To provide a
11 unified access to the images this module can be used. The images are
12 assigned a "sbmp::" constant, which is used as an index on a load
13 request. If loaded successfully, images are cached and the successive
14 requests return the cached values.
15
16 The images can be loaded as "Prima::Image" and "Prima::Icon" instances.
17 To discriminate, two methods are used, correspondingly "image" and
18 "icon".
19
21 use Prima::StdBitmap;
22 my $logo = Prima::StdBitmap::icon( sbmp::Logo );
23
25 Methods
26 icon INDEX
27 Loads INDEXth image frame and returns "Prima::Icon" instance.
28
29 image INDEX
30 Loads INDEXth image frame and returns "Prima::Image" instance.
31
32 load_std_bmp %OPTIONS
33 Loads "index"th image frame from "file" and returns it as either a
34 "Prima::Image" or as a "Prima::Icon" instance, depending on value
35 of boolean "icon" flag. If "copy" boolean flag is unset, the cached
36 images loaded previously can be used. If this flag is set, the
37 cached value is never used, and the created image is not stored in
38 the cache. Since the module's intended use is to provide shared and
39 read-only access to the image library, "copy" set to 1 can be used
40 to return non-shared images.
41
42 The loader automatically scales images if system dpi suggests so.
43 If layering is supported, the icon scaling will use that. To
44 disable these optimizations use "raw => 1" (to disable all)
45 construct, or "argb => 0" ( to disable ARGB icons ).
46
47 Constants
48 An index value passed to the methods must be one of "sbmp::" constants:
49
50 sbmp::Logo
51 sbmp::CheckBoxChecked
52 sbmp::CheckBoxCheckedPressed
53 sbmp::CheckBoxUnchecked
54 sbmp::CheckBoxUncheckedPressed
55 sbmp::RadioChecked
56 sbmp::RadioCheckedPressed
57 sbmp::RadioUnchecked
58 sbmp::RadioUncheckedPressed
59 sbmp::Warning
60 sbmp::Information
61 sbmp::Question
62 sbmp::OutlineCollapse
63 sbmp::OutlineExpand
64 sbmp::Error
65 sbmp::SysMenu
66 sbmp::SysMenuPressed
67 sbmp::Max
68 sbmp::MaxPressed
69 sbmp::Min
70 sbmp::MinPressed
71 sbmp::Restore
72 sbmp::RestorePressed
73 sbmp::Close
74 sbmp::ClosePressed
75 sbmp::Hide
76 sbmp::HidePressed
77 sbmp::DriveUnknown
78 sbmp::DriveFloppy
79 sbmp::DriveHDD
80 sbmp::DriveNetwork
81 sbmp::DriveCDROM
82 sbmp::DriveMemory
83 sbmp::GlyphOK
84 sbmp::GlyphCancel
85 sbmp::SFolderOpened
86 sbmp::SFolderClosed
87 sbmp::Last
88
89 Scalars
90 $sysimage scalar is initialized to the file name to be used as a source
91 of standard image frames by default. It is possible to alter this
92 scalar at run-time, which causes all subsequent image frame request to
93 be redirected to the new file.
94
95 Scaling
96 Note: the module scales the images automatically with the resolution.
97 Therefore it is advisable to use the module's function after
98 Application object is loaded.
99
101 Dmitry Karasik, <dmitry@karasik.eu.org>.
102
104 Prima, Prima::Image, Prima::Const.
105
106
107
108perl v5.34.0 2021-07-22 Prima::StdBitmap(3)