Re: How to get a drawing area widget as a file?.

2006-04-28 Thread Kalle Vahlman

On 4/28/06, sadhees kumar <[EMAIL PROTECTED]> wrote:

gtk_widget_realize(da_setting_ff);

pixbuf =
gdk_pixbuf_get_from_drawable(NULL,GTK_DRAWABLE(da_setting_ff)->window [...]


That should be GTK_DRAWABLE(GTK_WIDGET(da_setting_ff)->window) probably...

[...]

gdk_pixbuf_save (pixbuf, "/root/handle.bmp", "bmp",NULL, "100", NULL);


"/root/" o_O

--
Kalle Vahlman, [EMAIL PROTECTED]
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


How to get a drawing area widget as a file?.

2006-04-28 Thread sadhees kumar
Hi all,
 
   Im desperately trying to get a drawing area widget as a bmp file but in vain. My code looks like this.
 
 

colormap = gtk_widget_get_colormap(da_setting_ff);
gtk_widget_realize(da_setting_ff);
pixbuf = gdk_pixbuf_get_from_drawable(NULL,GTK_DRAWABLE(da_setting_ff)->window,colormap,da_setting_ff->allocation.x, da_setting_ff->allocation.y, 0, 0,da_setting_ff->allocation.width, da_setting_ff->allocation.height
);
bpp = gdk_pixbuf_get_bits_per_sample(pixbuf);
printf("%d\n", bpp);
gdk_pixbuf_save (pixbuf, "/root/handle.bmp", "bmp",NULL, "100", NULL); 
g_object_unref(pixbuf);
 
 
 The above code was not working, I got an error saying something like "src != NULL failed". I would like to know whats wrong in that. Is there any other means to get the drawing area in to the pixbuf?.If so please let me know.

 
-- _Regards,K.Sadheeskumar. 
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list