How to save the current window as an image file, for example png?
I know that I can get gdkWindow from current windows. I can even get an image. From this image structure, I can even request every pixel. But from what I understand, I really need to get pixbuf.
int width; int height; this.GetSize(width, height); this.GdkWindow.GetImage(0,0,width,height).?
How to get pixbuf from gtk window or gdk window or gdk image?
EDIT
int width; int height; this.GetSize(out width, out height); Pixbuf pixbuf = Pixbuf.FromDrawable (this.GdkWindow, this.Colormap, 0, 0, 0, 0, width, height); pixbuf.Save("/tmp/out.png","png");
works. Png is exported with the correct size, but blurred.
EDIT 2
The solution works. Blur was a mistake viewing images of gnomes
source share