Help with GdkPIxbuf and GtkImage...



Hi.

I have a GtkImage in my glade file which I am trying to get to display image data that I have in memory. The data is in raw format, 3 bytes per pixel RGB. So, this is sort of what I'm trying to do now (v->image_data is a struct member with the array of guchar containing my image data)...

GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data(   v->image_data,
                                               GDK_COLORSPACE_RGB,
                                               FALSE,
                                               8,
                                               320,
                                               240,
                                               960,
                                               NULL,
                                               NULL );

GtkWidget *image1 = glade_xml_get_widget (gxml, "image1");
gtk_image_set_from_pixbuf(GTK_IMAGE(image1), pixbuf);

gtk_widget_show(image1);


Any pointers as to what I might be doing wrong?

Thanks,
Micah



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