[cairo] Dealing with 1bpp bitmaps in cairo
mleisher at gmail.com
Thu Dec 22 08:35:20 PST 2011
In updating http://www.math.nmsu.edu/~mleisher/Software/gbdfed to use
GTK+ 3 and cairo, I needed to render a moderate number (128 to 256) of
discrete 1bpp images. After lots of experimentation, I finally settled
on the code below.
Please note that this code has not been tested for endian issues yet, so
some tweaking may be necessary.
FYI: once you have the surface, you can call cairo_mask_surface() to
actually render the bitmap. Took me a while to figure that one out.
If there is any better way to deal with this, please let me know.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1651 bytes
Desc: not available
More information about the cairo