Generic Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version

## contents

Arguments: texture

Returns a value that specifies the pixels that form the image of a `pixmap`. The value may be set either by calling (setf contents) or by passing the `:contents` initarg to make-instance when creating the pixmap.

pixmap should be a pixmap object. See cg-pixmaps.htm for an overview of pixmap functionality.

The value returned by contents or passed to (setf contents) is a list of lists, where each inner list represents a row of the pixmap and each member of an inner list represents a pixel in that row. Each row member should be an index into the pixmap's colors vector, to make the pixel display the color at that index. (An exception is that if the pixmap has a mask, then any transparent pixels should be zero in the contents.)

The number of inner lists reflects the number of rows in the pixmap, and the number of members in each inner list (these should all be the same) reflect the number of columns. The width, height, and bits-per-pixel properties of a pixmap will be derived automatically from the contents if needed.

The pixels of a pixmap may alternately be specified either by specifying the texture property.

### Example

Here is how the :default-leaf pixmap (used by outline widgets) is created. This pixmap also uses the default colors from default-pixmap-color-vector.

    (cache-pixmap
     (make-instance 'pixmap
       :name :default-leaf
       :contents
       '((15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15)
         (15 15  0  0  0  0  0  0  0 15 15 15 15 15 15 15)
         (15 15  0 15 15 15 15 15  0  0 15 15 15 15 15 15)
         (15 15  0 15 15 15 15 15  0 15  0 15 15 15 15 15)
         (15 15  0 15 15 15 15 15  0 15 15  0 15 15 15 15)
         (15 15  0 15 15 15 15 15  0 15 15 15  0 15 15 15)
         (15 15  0 15 15 15 15 15  0  0  0  0  0  0 15 15)
         (15 15  0 15 15 15 15 15 15 15 15 15 15  0 15 15)
         (15 15  0 15 15 15 15 15 15 15 15 15 15  0 15 15)
         (15 15  0 15 15 15 15 15 15 15 15 15 15  0 15 15)
         (15 15  0 15 15 15 15 15 15 15 15 15 15  0 15 15)
         (15 15  0 15 15 15 15 15 15 15 15 15 15  0 15 15)
         (15 15  0 15 15 15 15 15 15 15 15 15 15  0 15 15)
         (15 15  0 15 15 15 15 15 15 15 15 15 15  0 15 15)
         (15 15  0  0  0  0  0  0  0  0  0  0  0  0 15 15)
         (15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15))))

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version