RGB image drawing



I'm currently trying to draw an RGB image onto the screen. My latest
approach is to load the image, create a pixmap, draw the image onto the
pixmap and then draw the pixmap onto a drawing_area. The problem is that
the program sigsevs at the gdk_draw_rgb_image call. This is the relevant
code:

gint configure_event(GtkWidget *widget, GdkEventConfigure *event)
{

        if(gdkpixmap)
                gdk_pixmap_unref(gdkpixmap);


        gdk_pixmap_new(widget->window,
                        widget->allocation.width,
                        widget->allocation.height,
                        -1);
        gdk_draw_rgb_image(gdkpixmap,
                        widget->style->fg_gc[0], <- Not clear about this
                        0,0,
                        piccy->width, piccy->height,
                        GDK_RGB_DITHER_NONE,
                        piccy->Image,
                        piccy->width);
        g_print("here\n");
        return TRUE;
}

Also, just after gtk_init() I call gdk_rgb_init(). Any help much
appreciated.

Cheers
	Dave

-- 
Dave Swegen <dave@recursive.prestel.co.uk>
.plan: To find a job working with Linux



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