Re: alpha channel in GdkPixbuf



Ron Steinke <rsteinke w-link net> writes:

> Is there any way to extract the alpha channel information from
> a GdkPixbuf (for example, writing it to an array or a grayscale
> pixmap)?

The bytes of a GdkPixbuf are available as:

guchar *gdk_pixbuf_get_pixels (const GdkPixbuf *pixbuf);

The alpha value at x,y is:

 pixels[rowstride * y + x * 4 + 3];

Regards,
                                        Owen




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