| Allegro CL version 8.2 Unrevised from 8.1 to 8.2. 8.1 version |
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:
nil
, a unique
symbol based on the name of the file from which the pixmap was loaded
is created and used for the name.
nil
or an existing pixmap object to
re-use. If
nil
, a new pixmap object is created and
returned. If a pixmap, the pixmap is "filled in" with the information
read from the file and then returned. This argument may be useful for
updating a pixmap object from an edited (or alternate) file while
keeping the pixmap eq to the
former version of it.
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.
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-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.1 page.
Created 2010.1.21.
| Allegro CL version 8.2 Unrevised from 8.1 to 8.2. 8.1 version |