Snapshot!!!



Hi Friends! 
How can I take a screenshot from part of my own
application?
I have some examples, but they take screenshot from
the
upper left corner on the screen.


void save_snap ()
{


        GdkDrawable *root;
	GdkWindow *parent;
//	gdk_draw_drawable (parent, NULL, , 
	
//	GdkPixbuf *pixbuf;
//Something wrong?!!	
root = gdk_get_default_root_window ();
int b = 100;
int	g=100 ;	
	pixbuf = gdk_pixbuf_get_from_drawable (NULL, root,
NULL, 100, 100 /*area->allocation.x,
area->allocation.y*/,						 b, g,
(GLint)area->allocation.width,
(GLint)area->allocation.height);
 
//END Something wrong :-)

	file = gtk_file_selection_new ("Save snapshot to 
file");
	g_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION
(file) -> ok_button), "clicked",
	G_CALLBACK (save_file_new), file);
	gtk_signal_connect_object (GTK_OBJECT
(GTK_FILE_SELECTION (file) -> cancel_button),
"clicked",
						GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT
(file) );
	g_signal_connect (GTK_OBJECT (file), "destroy",
G_CALLBACK (window_destroy), NULL);
	gtk_widget_show (file);
}

Thank's a lot in advance.



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/



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