6.2 bitmap%
A bitmap% object is a pixel-based image, either
monochrome or color.
Sometimes, a bitmap object creation fails in a low-level manner. In
that case, the
ok? method returns #f, and the bitmap cannot be supplied to methods
that consume or operate on bitmaps (otherwise, an exn:fail:contract exception is raised).
(make-object bitmap%->bitswidthheight)bitmap%object
bits: byte string
width: exact integer in [1, 10000]
height: exact integer in [1, 10000]Creates a monochrome bitmap from an array of bit values, where each byte in
bitsspecifies eight bits, and padding bits are added so that each bitmap line starts on a character boundary. A1bit value indicates black, and0indicates white. Ifwidthtimesheightis larger than 8 times the length ofbits, anexn:fail:contractexception is raised.
(make-object bitmap%->widthheightmonochrome?)bitmap%object
width: exact integer in [1, 10000]
height: exact integer in [1, 10000]
monochrome?=#f: booleanCreates a new bitmap. If
monochrome?is#f, the bitmap matches the display depth of the screen. The initial content of the bitmap is undefined.
(make-object bitmap%->namekindbg-color)bitmap%object
name: path
kind='unknown: symbol in'(unknown unknown/mask gif gif/mask jpeg png png/mask xbm xpm bmp pict)
bg-color=#f:color%object or#fCreates a bitmap from a file, where
kindspecifies the kind of image file. Seeload-filefor details.
Methods
get-argb-pixels
get-depth
get-gl-config
get-height
get-loaded-mask
get-width
is-color?
load-file
ok?
save-file
set-gl-config
set-loaded-mask