On Thursday, 22 September 2016 at 07:50:07 UTC, Antonio Corbi wrote:
On Thursday, 22 September 2016 at 02:21:16 UTC, Konstantin Kutsevalov wrote:
On Wednesday, 21 September 2016 at 16:36:32 UTC, Adam D. Ruppe wrote:
[...]

Hmm, that's good idea as fast solution. Thank you Adam.


Hi Konstantin,

I've got a simple example in Vala language but it's very easy to rewrite it in D thank's to GtkD (and also thanks to Mike Wey for his work in GtkD!):

//  compile: valac --pkg gtk+-3.0 --pkg gdk-3.0  screenshot.vala

int main (string[] args) {
    Gtk.init (ref args);

    int  width, height;

    Gdk.Window win = Gdk.get_default_root_window();

    width = win.get_width();
    height = win.get_height();

Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height);

    screenshot.save("screenshot.png","png");
    return 0;
}

Ok, took the time to translate it to D and created a github repo to clone. You can download and try it from: https://github.com/antoniocorbibellot/dsshot

Hope It helps you.
Antonio

Reply via email to