gdk_draw_rgb_32_image()



Hi

I'm trying to use gtk to draw a image loaded from file in
a window and display it.
I use libtiff for reading the imagefile into a
uint32 *raster buffer. Then I create a GtkWidget window and
a GtkWidget drawing area. In the expose_event for the
drawing area I was planing on using gdk_draw_rgb_32_image()
to draw the image.
I thought the following would be enough:
/* i is a global pointer to a struct that contains 
 * the uint32 *raster buffer and its with and height in
 * pixels
 */
static gint expose_event (GtkWidget *widget, GdkEventExpose *event) {
   gdk_draw_rgb_32_image(widget->window,
                        widget->style->white_gc,
                        event->area.x, event->area.y, i->w, i->h,
                        GDK_RGB_DITHER_NONE, i->raster, i->w);
   return FALSE;
}                                             

When running my program it segfaults on the gdk_draw_rgb_32_imgage().
The i pointer is valid and so is i->raster

What am I doing wrong?

-- 
//-----------------------//-------------------------------------------------
//  Hrafnkell Eiriksson  //  Student of Computer- and Electrical engineering
//  hkelle@rhi.hi.is     //  at the Univeristy of Iceland
//                       //  "Blessed are they who go around in circles,
//  Finger for PGP key   //   for they shall be known as Wheels"



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