Class XbpBitmap() Foundation
Class function of the XbpBitmap class.
The XbpBitmap class provides objects that can display and manage graphic images. Images that exist only in memory should be distinguished from those that are saved in a file. Bitmap files must be linked to the EXE file using the resource compiler in order for the bitmap to be loaded using the :load() method of the XbpBitmap object. The :make() method requests the required memory space for raster images that are created as bitmaps in memory.
The creation of an XbpBitmap object using the method :create() needs a presentation space to be specified that is already associated with an output device. This is generally the PS of the active window or a PS that is linked to a printer. Specifying the PS in the call to this method ensures that the XbpBitmap object is compatible with the corresponding PS and its output device. The image is displayed using the method :draw() that must specify the PS where the output is to take place.
Supported image formats
An XbpBitmap object is able to process and display not only raster images (bitmaps, BMP format) but also images stored in different graphics formats. In addition to BMP formats, GIF (Graphics Interchange Format), JPEG (Joined Photographic Experts Group) and PNG (Portable Network Graphics) images can be processed.
XbpBitmap objects support several ways of achieving transparency in raster images:
Background masking (chroma keying)
This involves defining a key color for identifying the parts in the image which should be replaced with background information by the :draw() method. Image formats such as PNG or GIF support saving the key color along with the actual image data. In this case, the image will automatically be displayed transparent after it is loaded. The key color can also be application-supplied, for example, for using image formats which do not support transparency. See the method :getDefaultBgColor() for further information.
Per-pixel transparency (alpha channel)
In images using an alpha channel transparency information is saved for each pixel along with the pixel's color value. Per-pixel transparency is supported in PNG images with 32 bit color depth. See :hasAlphaChannel for further information.
This involves applying a constant opacity factor for the whole image during output. Blending is supported irrespective of whether transparent areas are defined in the image itself. See the member variable :transparency for information.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.