tags:

views:

27

answers:

1

I have a buffer of pixel values. Is it possible to display that buffer as an image using pixbuf in gtk. i will be using c language.

+1  A: 

yes, have a look at the function:

gdk_pixbuf_new_from_data ()

GdkPixbuf *         gdk_pixbuf_new_from_data            (const guchar *data,
                                                         GdkColorspace colorspace,
                                                         gboolean has_alpha,
                                                         int bits_per_sample,
                                                         int width,
                                                         int height,
                                                         int rowstride,
                                                         GdkPixbufDestroyNotify destroy_fn,
                                                         gpointer destroy_fn_data);

(In the docs)

vulkanino
thanks for your reply...but the definition of this function says that it can display 8bits per pixel only....what if we have more than 8 bits per pixel? do we have any way out?
linuxnewbie