I'm trying to capture an image of either the current window or a widget and save it to an image file. T开发者_运维技巧he problem is that I'm using Gtk# on Mono, so it needs to be a solution that'll work with that.
Essentially, something like this:
myWidget.SaveImage("imageFile.png");
I'd prefer a PNG or JPEG, but a raw bitmap will do.
You should be able to do this using Gdk.
This is very similar to this question: How to take a screenshot with Mono C#?
I've also found a php-gtk example here: http://php-gtk.eu/code-hints/grabbing-a-screenshot-with-gdk
精彩评论