Name: Anonymous 2007-02-03 19:10
To go straight to the problem: i need ruby, to without my help, be able to retrive window contents in the form of a bitmap or other image format.
My first approach was to with BitBlt or similar functions to simply toss over it to some ruby object and then read from that. It failed horribly as i was unable to get the DC handle to any such thing.
So i figured, "printscreen put the shit into a bitmap format. that will probably be a easier approach!"
okay, i do printscreens with keybd_event. no problem there, but how the fuck should i acess the data then? the win32 documentation babbles on about opening the clipboard to be able to read from it, something which also requires you to do a EmptyClipboard call or some shit, effectively annihilating whatever data is in the clipboard already. Not that it matters as my program runs without a window for which i can get the handle to, and the way to associate the clipboard to active task fails.
so could anyone help me with these issues, or suggest another way to do this?
as of now the only way i've got left is to have the shit pasted into paint and saved and then acessed. but that's a horribly inefficient method, i'd like to be able to acess it without having to do a hellish amount of unnessecary tasks or writing to harddrive, as i will need to have this repeated quite often
My first approach was to with BitBlt or similar functions to simply toss over it to some ruby object and then read from that. It failed horribly as i was unable to get the DC handle to any such thing.
So i figured, "printscreen put the shit into a bitmap format. that will probably be a easier approach!"
okay, i do printscreens with keybd_event. no problem there, but how the fuck should i acess the data then? the win32 documentation babbles on about opening the clipboard to be able to read from it, something which also requires you to do a EmptyClipboard call or some shit, effectively annihilating whatever data is in the clipboard already. Not that it matters as my program runs without a window for which i can get the handle to, and the way to associate the clipboard to active task fails.
so could anyone help me with these issues, or suggest another way to do this?
as of now the only way i've got left is to have the shit pasted into paint and saved and then acessed. but that's a horribly inefficient method, i'd like to be able to acess it without having to do a hellish amount of unnessecary tasks or writing to harddrive, as i will need to have this repeated quite often