Programmer Reference : Common Graphics : Using pixmaps : Creating a pixmap using createPixmap:
Creating a pixmap using createPixmap:
In this example, a pixmap is created with a width of 500, a height of 50, and a depth equal to that of the root window. depth is a CgWindow accessor method that returns the depth of the window.
| window pixmap |
window := CgWindow default.
pixmap := window
createPixmap: 500
height: 50
depth: window depth
The contents of a newly created pixmap are undefined.
Freeing pixmaps
The application is responsible for releasing pixmaps (including bitmaps) from memory when they are no longer required. Depending on their dimensions, these objects can take up large amounts of memory. Pixmaps are freed by sending the freePixmap message to a CgPixmap object.
pixmap freePixmap
Last modified date: 01/29/2015