Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 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-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