Prima::StdBitmap(3)
π Prima::StdBitmap β a lil' treasure chest of standard bitmaps
okay so bestie, this is Prima::StdBitmap(3) from the User Contributed Perl Documentation, and it's literally the module that hands out the toolkit's shared standard images. Let's get into it π
β¨ NAME β¨
Prima::StdBitmap β shared access to the standard bitmaps. yes, shared, as in everybody's using the same ones, no cap π«Ά
πΈ DESCRIPTION πΈ
So the toolkit ships a file called sysimage.gif that contains the standard Prima image library β a whole predefined set of images that different modules use. To give everyone unified access to the images inside that file, you use this module's API. Iconic behavior, honestly.
Every image is assigned to an sbmp:: constant, and that constant is what you use as an index when you request an image to be loaded. And the way that caching works? If an image loads successfully, the result gets cached, and every successive request just reuses the cached image. efficient queen π
The images can be loaded as Prima::Image and Prima::Icon instances, by two methods β correspondingly image and icon. two methods, two vibes, one image file π
π¦ SYNOPSIS π¦
use Prima::StdBitmap;
my $logo = Prima::StdBitmap::icon( sbmp::Logo );
that's it, that's the whole thing, slay β¨
π API π
π Methods
icon INDEXβ loads the INDEXth image frame and returns aPrima::Iconinstance. cute little icon, ready to go πimage INDEXβ loads the INDEXth image frame and returns aPrima::Imageinstance. same deal, but you get the raw image vibe πΌοΈload_std_bmp %OPTIONSβ the main character of the loading process, fr fr. It loads theindexth image frame fromfileand returns it as either aPrima::Imageor aPrima::Iconinstance, depending on the value of the booleaniconflag. If thecopyboolean flag is unset, a cached image can be used. If it's set, a cached image is never used and the created image is neither stored in the cache. Since the module's whole intended use is to provide shared and read-only access to the image library, settingcopyto 1 is what you do to get non-shareable images β i.e. ones you're allowed to mess with, bestie π
The loader automatically scales images if the system dpi suggests so. And if layering is supported, the icon scaling will use that too. To disable these optimizations, pass raw => 1 to disable all optimizations, and argb => 0 to disable producing ARGB icons π
ngl, the "don't touch the shared ones" rule is real β if you wanna scribble on an image, that's what copy is for.
π Constants
An index value passed to the methods must be one of the sbmp:: constants, and here's the full roster β every single one, no skips π
sbmp::Logo
sbmp::CheckBoxChecked
sbmp::CheckBoxCheckedPressed
sbmp::CheckBoxUnchecked
sbmp::CheckBoxUncheckedPressed
sbmp::RadioChecked
sbmp::RadioCheckedPressed
sbmp::RadioUnchecked
sbmp::RadioUncheckedPressed
sbmp::Warning
sbmp::Information
sbmp::Question
sbmp::OutlineCollapse
sbmp::OutlineExpand
sbmp::Error
sbmp::SysMenu
sbmp::SysMenuPressed
sbmp::Max
sbmp::MaxPressed
sbmp::Min
sbmp::MinPressed
sbmp::Restore
sbmp::RestorePressed
sbmp::Close
sbmp::ClosePressed
sbmp::Hide
sbmp::HidePressed
sbmp::DriveUnknown
sbmp::DriveFloppy
sbmp::DriveHDD
sbmp::DriveNetwork
sbmp::DriveCDROM
sbmp::DriveMemory
sbmp::GlyphOK
sbmp::GlyphCancel
sbmp::SFolderOpened
sbmp::SFolderClosed
sbmp::Last
okay sbmp::Last is giving "end of the list, periodt" π
π Scalars
The $sysimage scalar is initialized to the file name to be used as a source of standard images. And yes β it's possible to alter this scalar at run-time, which causes all subsequent image frame requests to be redirected to the new file. hot-swap the whole image source, iykyk π₯
π§ Scaling and ARGB-shading
The loading routine scales and visually enhances the images automatically, according to the system settings that are reported by the Prima::Application class. Which means it is therefore advisable to load images after the Application object is created β like, don't jump the gun, bestie β
timing matters here: create your Application object first, then go grab your images. otherwise the auto-scaling has nothing to vibe-check against π
πΈ AUTHOR πΈ
Dmitry Karasik, <dmitry@karasik.eu.org>. king behavior π
β SEE ALSO β
Prima, Prima::Image, Prima::Const. go read those next, they're all part of the same friend group π«Ά
aaaand that's the whole page, bestie! π this gem is from perl v5.42.0, dated 2024-08-20, and it's the Prima::StdBitmap(3) man page β now go load some sbmp:: constants and be iconic ππβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms