gdk_pixbuf_render_to_drawable_alpha() causes segfault?



first sorry for cross posting, i posted this originally to gtk-app-devel but nobody seemed to know.

you'll have to excuse my stupidity on these issues. this is my first attempt at coding anything for linux/x (and using gtk ;/)

anywho im trying to display transparent png's (actually one on top of another) in a fixed container. (eventually they will become sort of graphical buttons but thats another story).

i originally used gdk_pixbuf_render_pixmap_and_mask() but id like to use true alpha and not the alpha tolerence.. (is this function avail w/out that?)

gdk_pixbuf_render_to_drawable_alpha causes a segfault (it works if i load no images or comment out the gdk_pixbuf_render_to_drawable_alpha line) :{ my code:

(animation bits here just for future implementation, also offset is just a global var i used for offsetting the images)

void setup_pixmap (char *filename, GtkWidget *fixed)
{
	GtkWidget *pix;
	GdkPixbufAnimation *anim;
	GdkPixbuf *unanim;

	if (filename == 0)
		return;
	
	anim = gdk_pixbuf_animation_new_from_file(filename, 0);
	if (gdk_pixbuf_animation_is_static_image(anim)){
		unanim = gdk_pixbuf_animation_get_static_image(anim);

		gdk_pixbuf_render_to_drawable_alpha (unanim, pix->window, 0, 0, 0, 0, -1, -1, GDK_PIXBUF_ALPHA_FULL, 0, GDK_RGB_DITHER_NONE, 0, 0);

		gdk_pixbuf_unref(unanim);
	}else{
		pix = gtk_image_new_from_animation(anim);
		gdk_pixbuf_animation_unref(anim);	
	}
		gtk_fixed_put (GTK_FIXED (fixed), pix, offset*30, offset*30);
		gtk_widget_show(pix);

	offset++;
}



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