FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version

save-lisp-pixmap

Arguments: pixmap filename

An alternative to save-pixmap that is probably more convenient for most uses is the function import-pixmaps.

Creates a file containing lisp source code for recreating a pixmap. The source code file (or the fasl file that results from compiling it) may be loaded in a later invocation of lisp or a runtime application in order to recreate the pixmap.

Alternately, the generated code may be copied into an application's source code and modified in order to assign the pixmap to a global variable or to return it from a function, for example. This allows the pixmap to be embedded in the image file of a runtime application so that neither the original .bmp file nor the lisp file created by save-lisp-pixmap needs to be distributed with an application.

Lisp pixmaps can be loaded with load-lisp-pixmap.

filename is a pathname or path namestring naming the file to be created. If a file already exists at this path, it is replaced by the newly created file.

pixmap is the pixmap object to be saved in the file.

There are a couple of alternate ways to embed code for recreating a pixmap in an application's source code, which may be handier than calling save-lisp-pixmap. One way is to evaluate a form such as

(pprint (recreation-code my-pixmap)) 

in the Debug window, and then to simply cut and paste the printed source code into the application.

Another way is to inspect a pixmap object, go to the internals tab, and click on the button at the right side of the top line to invoke the "extended editor" for the whole pixmap. The modal editor window that pops up will contain the recreation code for the pixmap, which could then be copied and pasted into application source code. (Though the extended editor is read-only in this case, you can still copy the text from it.)

Note that pixmaps used in controls on forms are automatically saved as lisp source code into the .bml file for the form, using a similar technique. So there is no need for an application to embed these pixmaps explicitly.

save-lisp-pixmap is rather slow for large pixmaps, so it may be preferable to distribute .bmp files with an application if managing the .bmp files is not problematic. See save-pixmap.


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.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version