How can I save the current window as an image file such as a png?
I know I can get a gdkWindow from current windows. I can even get an image. From this image struct I can even query each pixel. But from what I understand what I really need is to get a pixbuf.
int width;
int height;
this.GetSize(width, height);
this.GdkWindow.GetImage(0,0,width,height).?
How do I get a pixbuf from a gtk window or a gdk window or a 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");
is kinda working. A png is exported with the correct size but it is blurred.
EDIT 2
The solution is working. The bluriness was a bug of gnome image viewer