A patch to gdk_image_get
- From: Ron Steinke <rsteinke merilon elfhame net>
- To: gtk-devel-list gnome org
- Subject: A patch to gdk_image_get
- Date: Sun, 19 Nov 2000 09:42:05 -0800
This is a patch to gdk_image_get which allows you to
pass -1 as the width or height argument, and have the
image extend to the end of the source GdkWindow, in the
manner of, e.g., gdk_draw_pixmap. This is particularly useful
for converting a GdkPixmap of unknown size to a GdkImage.
This patch is the same as the patch gdk-rsteinke-001030-0.patch
uploaded to ftp.gtk.org.
Ron Steinke
diff -ur gtk+-1.2.8/gdk/gdkimage.c gtk+-1.2.8.local/gdk/gdkimage.c
--- gtk+-1.2.8/gdk/gdkimage.c Thu Sep 23 12:43:39 1999
+++ gtk+-1.2.8.local/gdk/gdkimage.c Mon Oct 30 11:09:25 2000
@@ -338,6 +338,13 @@
if (win_private->destroyed)
return NULL;
+ /* If width or height is -1, go to the end of the window. */
+
+ if(width == -1)
+ width = win_private->width - x;
+ if(height == -1)
+ height = win_private->height - y;
+
private = g_new (GdkImagePrivate, 1);
image = (GdkImage*) private;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]