Re: drawing area to image file ???
- From: Olexiy Avramchenko <ath beast stu cn ua>
- To: "42052670 <b4205267 nontri ku ac th>" <b4205267 ku ac th>
- Cc: gtk-list gnome org
- Subject: Re: drawing area to image file ???
- Date: Wed, 20 Nov 2002 17:51:34 +0200
42052670 wrote:
Can I save or snap my Drawing Area into image file such as JPG, GIF?
/* VERY SIMPLIFIED and UNTESTED example */
static void save_2_jpeg(GtkWidget *area)
{
GdkPixbuf *pixbuf;
pixbuf = gdk_pixbuf_get_from_drawable(
NULL,
area->window,
gtk_widget_get_colormap(area),
0,0,
0,0,
-1,-1
); /* getting pixbuf */
gdk_pixbuf_save(pixbuf, "drawingarea.jpeg", "jpeg", NULL); /*
saving pixbuf to jpeg */
g_object_unref(pixbuf); /* freeing pixbuf */
}
/* Olexiy */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]