CatchImage()

Syntax

Result = CatchImage(#Image, MemoryAddress)
Description
Load the specified image from the given memory area. If #PB_Any is used as '#Image' parameter, the new image identifier 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 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

Image Index - CopyImage() ->