src/swipl-devel/packages/xpce/man/refmanual/md/pixmap.md

class pixmap {#class-pixmap}

A pixmap object is a coloured image: a rectangular area of <-width x <-height pixels, each of which may have its own colour.

Coloured images are actually supported by class image using image <-kind: pixmap. This class is introduced to provide type specification for coloured images as needed for some graphical operations as well as automatic conversion of monochrome bitmaps into colour pixmaps.

This class is often used implicitly: `window ->background: @grey25_image' will automatically convert the @grey25_image into a pixmap using <-convert.

Explicit usage is normally done to create a coloured version of some monochrome bitmap:

?- new(I, pixmap(image('pce.bm'), red, green)).

Will create a version of the library image pce.bm using a red <-foreground and a green initialise.

Pixmaps are in general reusable objects like normal images. Therefore, the <-convert method ensure reuse of a pixmap create from some monochrome image.

Send methods {#class-pixmap-send}

Get methods {#class-pixmap-get}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.