[gtk+/rendering-cleanup: 13/124] tests: Use GdkPixbuf for taking a screenshot, not GdkImage



commit 640b36138278b3041d90d86f6bc09bda5e0e8748
Author: Benjamin Otte <otte redhat com>
Date:   Tue Jul 13 02:17:48 2010 +0200

    tests: Use GdkPixbuf for taking a screenshot, not GdkImage

 tests/testgtk.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 12fee48..e046808 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -2059,7 +2059,7 @@ take_snapshot (GtkWidget *button,
   GdkGC *black_gc;
   GdkColor color = { 0, 30000, 0, 0 };
   GdkRectangle target;
-  GdkImage *shot;
+  GdkPixbuf *shot;
   
   /* Do some begin_paint_rect on some random rects, draw some
    * distinctive stuff into those rects, then take the snapshot.
@@ -2186,12 +2186,13 @@ take_snapshot (GtkWidget *button,
   target.width = width_fraction * 2;
   target.height = height_fraction * 2;  
 
-  shot = gdk_drawable_get_image (gid->src->window,
-                                 target.x, target.y,
-                                 target.width, target.height);
-
-  gtk_image_set_from_image (GTK_IMAGE (gid->snap),
-                            shot, NULL);
+  shot = gdk_pixbuf_get_from_drawable (NULL,
+                                       gid->src->window,
+                                       NULL,
+                                       target.x, target.y,
+                                       0, 0,
+                                       target.width, target.height);
+  gtk_image_set_from_pixbuf (GTK_IMAGE (gid->snap), shot);
 
   g_object_unref (shot);
   



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