SuicideJunkie has asked for the wisdom of the Perl Monks concerning the following question:
I am currently using Win32::GuiTest to try and automate a series of screen captures, but I need to do some analysis of each captured image before deleting them.
Presently, I've resorted to saving them to disk and then parsing the resulting BMP back into memory before pondering the pixel grid:
Writing to disk just to immediately read it back is really silly and wasteful, but I needed to just get it done.sub grabWindowRegion { my $ds = new Win32::GuiTest::DibSect; $ds->CopyClient(shift,[@_]); $ds->SaveAs('temp.bmp'); return parseBMP('temp.bmp'); }
The DibSect object is opaque ($VAR1 = bless( do{\(my $o = 28375616)}, 'Win32::GuiTest::DibSect' );) to naive Dumpering, and I'm not seeing any perl source for it in the install directories.
In the end, I just want a 2D grid of pixel colors in an AoA ref or equivalent. At a minimum, the ability to peek at pixel values in the image.
How should I be doing this?
Current Solution:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::GuiTest - Processing screen captures in memory?
by BrowserUk (Patriarch) on Mar 19, 2011 at 20:22 UTC | |
by SuicideJunkie (Vicar) on Mar 19, 2011 at 23:38 UTC | |
by BrowserUk (Patriarch) on Mar 20, 2011 at 00:18 UTC | |
by SuicideJunkie (Vicar) on Mar 20, 2011 at 05:26 UTC | |
by BrowserUk (Patriarch) on Mar 20, 2011 at 06:05 UTC | |
| |
by Anonymous Monk on Mar 19, 2011 at 23:52 UTC |