| 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.
png is currently supported;
omitting format saves as PNG. Other format values are
rejected with a console message.<-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).