All Manuals > CAPI User Guide > 13 Graphics Ports > 13.9 Working with images


13.9.3 External images

An External Image is an intermediate object. It is a representation of a graphic but is not associated with a port and cannot be used directly for drawing.

An object of type external-image is created by reading an image from a file, or by externalizing an image object, or by copying an existing external-image . Or, if you have the image bitmap data, you can create one directly as in the examples/capi/buttons/button.lisp example.

The external-image contains the bitmap data, potentially compressed. You can copy external-image objects, or write them to file, or compress the data.

You cannot query the size of the image in an external-image object directly. To get the dimensions without actually drawing it on screen see Pixmap graphics ports.

If you create an image and want to externalize it to write it to file, follow this example:

(let ((image (gp:make-image-from-port pane
 10 10 200 200)))
      (gp:externalize-and-write-image pane
 image filename
(gp:free-image pane
 image))) Transparency Converting an external image

CAPI User Guide (Macintosh version) - 30 Aug 2011