+ gdk_threads_enter();
+
+ gtk_image_get_pixmap( GTK_IMAGE(win->widget), &canvas, NULL );
+ if(canvas == NULL) {
+ WARNING("Could not get pixmap");
+ return FALSE;
+ }
+
+ /* Scale the image if necessary */
+ if(info->width != width || info->height != height) {
+ GdkPixbuf *scaled = gdk_pixbuf_scale_simple(info->pixbuf, width, height, GDK_INTERP_BILINEAR);
+
+ /* Add the scaled image into the image cache */
+ scaled_info = g_new0(struct image_info, 1);
+ scaled_info->resource_number = info->resource_number;
+ scaled_info->width = gdk_pixbuf_get_width(scaled);
+ scaled_info->height = gdk_pixbuf_get_width(scaled);
+ scaled_info->pixbuf = scaled;
+ scaled_info->scaled = TRUE;
+ glk_data->image_cache = g_slist_prepend(glk_data->image_cache, scaled_info);
+
+ /* Continue working with the scaled version */
+ info = scaled_info;
+ }
+
+ gdk_draw_pixbuf( GDK_DRAWABLE(canvas), NULL, info->pixbuf, 0, 0, val1, val2, -1, -1, GDK_RGB_DITHER_NONE, 0, 0 );
+
+ /* Update the screen */
+ gtk_widget_queue_draw(win->widget);
+
+ gdk_threads_leave();