tests: Use GdkPixbuf for taking a screenshot, not GdkImage

This commit is contained in:
Benjamin Otte 2010-07-13 02:17:48 +02:00
parent 6d4bae5ccc
commit 58ef2afdfa

View File

@ -2070,7 +2070,7 @@ take_snapshot (GtkWidget *button,
GdkGC *black_gc; GdkGC *black_gc;
GdkColor color = { 0, 30000, 0, 0 }; GdkColor color = { 0, 30000, 0, 0 };
GdkRectangle target; GdkRectangle target;
GdkImage *shot; GdkPixbuf *shot;
/* Do some begin_paint_rect on some random rects, draw some /* Do some begin_paint_rect on some random rects, draw some
* distinctive stuff into those rects, then take the snapshot. * distinctive stuff into those rects, then take the snapshot.
@ -2197,12 +2197,13 @@ take_snapshot (GtkWidget *button,
target.width = width_fraction * 2; target.width = width_fraction * 2;
target.height = height_fraction * 2; target.height = height_fraction * 2;
shot = gdk_drawable_get_image (gid->src->window, shot = gdk_pixbuf_get_from_drawable (NULL,
gid->src->window,
NULL,
target.x, target.y, target.x, target.y,
0, 0,
target.width, target.height); target.width, target.height);
gtk_image_set_from_pixbuf (GTK_IMAGE (gid->snap), shot);
gtk_image_set_from_image (GTK_IMAGE (gid->snap),
shot, NULL);
g_object_unref (shot); g_object_unref (shot);