CatchImage()
Syntax
Result = CatchImage(#Image, MemoryAddress [, Flags])Description
Load the specified image from the given memory area. If #PB_Any is used as '#Image' parameter, the new image number will be returned as 'Result'.
The image can be in BMP, icon or any other format supported by the ImagePlugin library. If something wrong the 0 value is returned. A loaded image can be freed by using the FreeImage() command.
This command is useful when using the 'IncludeBinary' PureBasic keyword. Then images can be packed inside the executable. Nevertheless, use this option with care, as it will take more memory than storing the file in an external file (the file are both in executable memory and load in physical memory).
The optional 'Flags' parameter can be one of the following values:#PB_Image_DisplayFormat: Maps the image format to the actual desktop (screen) format, to have faster display performances. This can means color information loss, for example if the desktop is in 16 bits while the image is in 24 bits.
The following commands can be used to enable automatically more image formats:
UseJPEGImageDecoder()
UsePNGImageDecoder()
UseTIFFImageDecoder()
UseTGAImageDecoder()
Example:CatchImage(0, ?Logo) End Logo: IncludeBinary "Logo.bmp"Note: The "?" is a pointer to a label. More informations about pointers and memory access can be found in the relating chapter here. The image size is currently limited to 8192x8192 pixels (if the available memory allow it).
Supported OS
Windows, AmigaOS, Linux