diff options
author | William Jon McCann <william.jon.mccann@gmail.com> | 2014-02-13 12:08:03 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-02-13 20:47:25 -0500 |
commit | 9bb3b2ae3ce5e9e9a8776806211b2414f3ae8425 (patch) | |
tree | c8df9d19155eee72e66e3d9bac6a49821966feaa /docs/tools | |
parent | 7796e7863ccec070edf84a5aa2a6ecc3b9010c59 (diff) | |
download | gtk+-9bb3b2ae3ce5e9e9a8776806211b2414f3ae8425.tar.gz |
docs: get the pixbuf options from the existing instead of hardcoding.
Diffstat (limited to 'docs/tools')
-rw-r--r-- | docs/tools/shooter.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/tools/shooter.c b/docs/tools/shooter.c index 15e1daa224..8543318211 100644 --- a/docs/tools/shooter.c +++ b/docs/tools/shooter.c @@ -54,8 +54,12 @@ static GdkPixbuf * add_border_to_shot (GdkPixbuf *pixbuf) { GdkPixbuf *retval; + GdkColorspace colorspace; + int bits; - retval = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, + colorspace = gdk_pixbuf_get_colorspace (pixbuf); + bits = gdk_pixbuf_get_bits_per_sample (pixbuf); + retval = gdk_pixbuf_new (colorspace, TRUE, bits, gdk_pixbuf_get_width (pixbuf) + 2, gdk_pixbuf_get_height (pixbuf) + 2); @@ -78,8 +82,12 @@ remove_shaped_area (GdkPixbuf *pixbuf, XRectangle *rectangles; int rectangle_count, rectangle_order; int i; + GdkColorspace colorspace; + int bits; - retval = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, + colorspace = gdk_pixbuf_get_colorspace (pixbuf); + bits = gdk_pixbuf_get_bits_per_sample (pixbuf); + retval = gdk_pixbuf_new (colorspace, TRUE, bits, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf)); |