default icon loaded...
- From: Jason Brisbane <darkeen westnet com au>
- To: Gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: default icon loaded...
- Date: Mon, 07 May 2007 21:49:41 +0800
Hello,
What is the "broken-icon image" that is loaded into :
gtk_image_new_from_file ()
and how do I test for it?
Is it a certain type that I can test for?
Because when I try to resize it down into the size of the image with:
originalPage = gtk_image_get_pixbuf
(GTK_IMAGE(lookup_widget(themenagerie,"image_creature_pic")));
if ((originalPage != NULL) &&
((gdk_pixbuf_get_width(originalPage) > Iwidth) ||
(gdk_pixbuf_get_height(originalPage) > Iheight)))
{
if (gdk_pixbuf_get_width(originalPage) >
gdk_pixbuf_get_width(originalPage))
scale = (gdk_pixbuf_get_width(originalPage) / Iwidth) -1;
else
scale = (gdk_pixbuf_get_width(originalPage) / Iheight) -1;
Iwidth = gdk_pixbuf_get_width(originalPage) / scale ;
Iheight = gdk_pixbuf_get_height(originalPage) / scale;
scaledPage = gdk_pixbuf_scale_simple (originalPage, Iwidth,
Iheight, GDK_INTERP_BILINEAR);
gtk_image_set_from_pixbuf
(GTK_IMAGE(lookup_widget(themenagerie,"image_creature_pic")), scaledPage);
g_object_unref (scaledPage);
it always returns the runtime error as listed below due to the attempts
to resize this "broken-image-icon".
(battlemaster:16358): Gtk-CRITICAL **: gtk_image_get_pixbuf: assertion
`image->storage_type == GTK_IMAGE_PIXBUF || image->storage_type ==
GTK_IMAGE_EMPTY' failed
And testing with:
if
((gtk_image_get_storage_type(GTK_IMAGE(lookup_widget(themenagerie,"image_creature_pic")))
!= GTK_IMAGE_PIXBUF) &&
(gtk_image_get_storage_type(GTK_IMAGE(lookup_widget(themenagerie,"image_creature_pic")))
!= GTK_IMAGE_EMPTY))
doesnt seem to work...
How do I test for invalid icons without having to use the whole gdk
thing...?
--
---
Regards,
Jason Brisbane
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]