Re: Alpha rendering



Lars Clausen <lrclause cs uiuc edu> writes:

> What's the preferred way in GTK 2.0 to use a 8-bit gray image as an alpha
> mask for solid color rendering onto a drawable?  It should be reasonably
> fast and not depend on other libraries than what's in the GTK 2.0
> distribution.

You'll need to convert your 8-bit gray image to a 8-bit RGBA image
(create a pixbuf of the right size, use gdk_pixbuf_get_pixels(),
and just write into the data correctly taking into account
gdk_pixbuf_get_rowstride().) Then use gdk_pixbuf_render_to_drawable() 
to draw that.

There is no support for single-channel pixbufs in gdk-pixbuf or
GDK currently.

Regards,
                                        Owen





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]