A bitmap is a graphical that displays an image. Most of the behaviour to manipulate the pixels of a bitmaps thus can be found with class image.
Bitmaps (images) come in two flavours. If image<-kind
= bitmap, the elements of the bitmap are regarded as booleans: boolean
true (@on) is
painted in the graphical<-colour
of the bitmap and boolean false (@off)
in the current background. If image<-kind
is pixmap each individual pixel represents a colour.
Transparency comes from the image rather than from the bitmap: pixels
that the image's alpha channel calls transparent are not painted, and
the bitmap lets whatever is behind it show through. Use
image->has_alpha
to test whether an image has such pixels. Older versions had a bitmap<->transparent
to say that the @off
pixels of a bitmap-kind image should not be painted, and took it as the
second argument of bitmap->initialise;
both are gone.
Bugs:
Stencils are not implemented.
There are no means for scaling bitmaps: bitmap->geometry
moves a bitmap but ignores the requested size. Scale the image instead,
with
image<-scale.
<->access
both and bitmap<->bitmap @nil,
the bitmap<->bitmap variable of the
image is filled with the bitmap. Subsequent changes to the image are
forwarded to the bitmap.
<-width
and graphical<-height
as the image.
Note that images are automatically converted from names (see
image->initialise).
Thus, the following displays XPCE's icon on a picture window:
?- send(new(P, picture), open),
send(P, display,
bitmap('16x16/pce.xpm'), point(25, 25)).
By default, image
objects are cached (i.e. remain in memory).
If you have many or large ones, please study image->initialise
and image->load.
.path.
Backward compatibility only. New code should manipulate the image directly.
Defaults: The default search path is determined by the
resource bitmap.path. Its system
defined value is
.:~/lib/bitmaps:$PCEHOME/bitmaps:/usr/include/X11/bitmaps
Diagnostics: Fails silently on bad format or non-existing file.
<-image.<-convert
converts text of the form
<-convert
succeeds and returns a new bitmap from this image.