Re: Rgba to pixbuf

Mario Kemper <mario kemper googlemail com> writes:

how do I convert rgba information into a pixbuf? I have an array with
rgba values (0-255) for each pixel. How do I need to pack those
information in order to use Gtk2::Gdk::Pixbuf->new_from_data?

Bytes in a string, eg. "\377\0\0" for a red pixel.  8 bits per component
is all that's supported.

There's no size check as yet on the width x height vs the length of the
byte string you supply, so be careful with that, and also make sure it's
a byte string not a utf8 wide-char string thingie.

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