开发者

Capture image of window or widget in Mono

开发者 https://www.devze.com 2023-04-11 17:59 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消