Re: Byte array to Image
- From: Tim-Philipp Müller <t i m zen co uk>
- To: gtk-list gnome org
- Subject: Re: Byte array to Image
- Date: Sat, 27 Jun 2009 12:14:12 +0100
On Fri, 2009-06-26 at 18:45 +0100, António Pinho wrote:
> Hi there! I have a byte array that is data from an image.. how can i
> turn that array of bytes into a jpeg or bmp image file?
If your byte array image data is in RGB format, you can create a
GdkPixbuf from it using
http://library.gnome.org/devel/gdk-pixbuf/stable/gdk-pixbuf-creating.html#gdk-pixbuf-new-from-data
and then use gdk_pixbuf_save() to save it as jpeg:
http://library.gnome.org/devel/gdk-pixbuf/stable/gdk-pixbuf-file-saving.html#gdk-pixbuf-save
Cheers
-Tim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]