FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Moderate update since 9.0 release.
8.2 version

load-pixmap

Arguments: pathname &key name pixmap-to-return (icon-index 0) make-unique-name

Reads a pixmap from any device-independent bitmap file. These are typically .bmp files. You can also load .ico (icon) files on Windows, or X bitmap files on GTK (but see note about GTK on the Mac below).

The arguments are:

This function returns the loaded pixmap.

See also save-pixmap (which creates .bmp files) and load-lisp-pixmap (which loads a Lisp file which will recreate a pixmap). cg-pixmaps.htm discusses pixmaps in general.

Issue with locad-pixmap and GTM on Macs

There is a known but unsolved problem with load-pixmap on the Mac. On the GTK platforms (Linux and Mac), load-pixmap simply passes the pixmap file path to a single GTK function, and GTK does all the work. But it seems to fail on the Mac even for pixmaps where it works on Linux. We suspect that something in the substrate of GTK on the Mac is not supporting this GTK function properly.

One possible workaround is to create pixmaps from Lisp arrays of pixel values, as described in cg-pixmaps.htm. But note if you're starting with BMP files, the only way to use that approach would be to use the function import-pixmaps on a Linux or Windows machine that is able to load the BMP files, and then take the file of Lisp source code that it writes over to your application on the Mac and load the Lisp file there. When building a standalone application, if you load the Lisp file at build time then the pixmaps will be built into the image file and so will not need to be loaded from separate files at run time.


Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Moderate update since 9.0 release.
8.2 version