Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
Object described on page has changed in 10.0.
9.0 version


Arguments: pixmap filename &key (quality 100)

Saves a pixmap to a new file. Any pixmap can be written as a BMP, PNG, JPEG, TIFF, or GIF file. Note GIF files are supported only on the Windows platform.

pixmap is the pixmap to save. It may have been loaded from a file with load-pixmap, or copied from the screen with get-pixmap, or created programmatically from a lisp array of pixel values (see cg-pixmaps.htm).

filename is the path of the file to create. It can be either a pathname or a path namestring. If the file already exists it will be replaced.

quality is an integer between 0 and 100 inclusive, specifying a tradeoff value between image quality and file size. It is used only for jpeg files (though that possibly could change with enhancements to the encoders that are in the underlying windowing systems). The default value is 100, which means the highest quality and largest file size.

The kind of pixmap file that's written is determined by the pathname-type of the filename argument, which should be either bmp, png, jpeg, jpg, tiff, tif, or gif. BMP files are uncompressed and therefore the largest, while PNG files are smaller, and JPEG files (even when quality is 100) are typically smaller still.

One known unsolved problem on Windows is that it doesn't work to load a non-bmp pixmap from a file and then save it as a bmp file if you passed the use-gdi-plus argument to load-pixmap as true.

A pixmap could alternately be saved to a file as Lisp source code with save-lisp-pixmap.

See also cg-pixmaps.htm.

Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
The object described on this page has been modified in the 10.0 release; see the Release Notes.
Created 2016.6.21.

Allegro CL version 10.0
Object described on page has changed in 10.0.
9.0 version