summaryrefslogtreecommitdiff
path: root/demos/testpixbuf.c
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>2001-06-26 08:32:25 +0000
committerTim Janik <timj@src.gnome.org>2001-06-26 08:32:25 +0000
commitbf0d61a59b9e1b889ba98b36b05a90e76f64eced (patch)
treefe8a750554c398b744dbfd4b99eb617122344b00 /demos/testpixbuf.c
parent0e0ee24bea94062f9dc3d82007cc5184a7f79b3a (diff)
downloadgdk-pixbuf-bf0d61a59b9e1b889ba98b36b05a90e76f64eced.tar.gz
use gdk_pixbuf_new_from_stream(). fixed up item factory so inlined pixbufs
Tue Jun 26 10:04:30 2001 Tim Janik <timj@gtk.org> * gtk/gtkiconfactory.c: * gtk/gtkitemfactory.c: use gdk_pixbuf_new_from_stream(). fixed up item factory so inlined pixbufs actually work. Tue Jun 26 09:48:02 2001 Tim Janik <timj@gtk.org> * Makefile.am (noinst_PROGRAMS): get rid of make-inline-pixbuf * gdk-pixbuf-data.[hc]: provide gdk_pixbuf_new_from_stream() instead from gdk_pixbuf_new_from_inline(). * gdk-pixdata.[hc]: auxillary GdkPixdata structure, public installed API for applications that need to serialize/deserialize on their own (gimp, BEAST). * gdk-pixbuf/gdk-pixbuf-csource.c: provide publically installed program that can dump images in CSource format and Pixbuf stream format. supports RLE encoding, MACRO formatting etc... invoke with --help.
Diffstat (limited to 'demos/testpixbuf.c')
-rw-r--r--demos/testpixbuf.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/demos/testpixbuf.c b/demos/testpixbuf.c
index 0af6d368e..a2ecbe1f0 100644
--- a/demos/testpixbuf.c
+++ b/demos/testpixbuf.c
@@ -543,7 +543,8 @@ main (int argc, char **argv)
i = 1;
if (argc == 1) {
const gchar*** xpmp;
-
+ GError *error = NULL;
+
pixbuf = gdk_pixbuf_new_from_data (default_image, GDK_COLORSPACE_RGB, FALSE, 8,
DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_WIDTH * 3,
NULL, NULL);
@@ -557,11 +558,18 @@ main (int argc, char **argv)
}
/* Test loading from inline data. */
- pixbuf = gdk_pixbuf_new_from_inline (apple_red, FALSE, -1, NULL);
- new_testrgb_window (pixbuf, "Red apple from inline data");
-
- pixbuf = gdk_pixbuf_new_from_inline (gnome_foot, TRUE, sizeof (gnome_foot), NULL);
- new_testrgb_window (pixbuf, "Foot from inline data");
+ pixbuf = gdk_pixbuf_new_from_stream (-1, apple_red, FALSE, &error);
+ if (!pixbuf)
+ {
+ fprintf (stderr, "failed to construct \"red apple\" pixbuf: %s\n",
+ error->message);
+ g_error_free (error);
+ }
+ else
+ new_testrgb_window (pixbuf, "Red apple from inlined RLE data");
+
+ pixbuf = gdk_pixbuf_new_from_stream (sizeof (gnome_foot), gnome_foot, TRUE, NULL);
+ new_testrgb_window (pixbuf, "GNOME Foot from inlined RLE data");
found_valid = TRUE;
} else {