| Did you know ... | Search Documentation: |
| Send methods |
new(I, image(File)).
The constructor first looks File up in @images;
on a hit it returns the existing instance. Otherwise it builds a new
image and image->loads
its pixels from the file. Such images get image<-access read.new(I, image(@nil, Width, Height)). These images are not
pooled and have image<-access both.
The kind argument selects between pixmap
(default) and
bitmap.
->load <-lookupsource_sink. When the
source is a file, it is first located via file->find
on
path (defaults to image.path).
The decoder is SDL_image, so PNG, JPEG, BMP, GIF, PCX and the other formats supported by SDL_image all load. SVG is recognised by file extension or by sniffing the stream and is rendered through SDL's size-aware SVG loader:
<-width and image<-height
non-zero → SVG is rendered at exactly that size;Streams that are not SVG fall back to a built-in PNM reader when SDL_image cannot interpret them.
format only serves to say so explicitly and may be
omitted. xpce 6 accepted a range of X11-era formats here (xbm,
pnm, gif, ...); none of these are written any
more.
in defaults to image<-file,
the file the image was loaded from. That is a source_sink rather than a
file: if it is not something we can write to, image->save
fails with a message on the console.
<-scale.->draw_in
to blit an image into a sub-area instead.graphical (or image) onto the
receiver at the given offset (default point(0,0)).pixmap, 0 for bitmap).|bool(x, y) to the given colour (for pixmap)
or boolean (for bitmap).alpha < 255).