Hi

Look at this, no mainloop, no windows, before and after screenshot, and optional prompt for filename

I know that events and "main-line code" run asynchronously.

No they don't.

In addition, is there a way to select a specific window among the many to capture.

Not with stock wxWidgets, since its all about windows your app creates. There is probably an extension you could wrap, or you could use Imager::Screenshot / Win32::GuiTest / X11::WindowHierarchy

However, the results are inconsistent. The entire screen is not captured every time it's run. I had to force the example window to the top the get it captured. Otherwise the lower level windows get captured.

That seems to be the what Re: capture what's on the screen was designed to do. Ooops, I just cited the source :)

It makes a difference where the Update and TakeScreenShot calls are placed(see comments below). Why????

Because an Update is not Refresh, and doesn't necessarily trigger any wxPaintEvent ...

After restructuring and cleaning up several bugs, I have it working.

They probably weren't bugs in 2003 :) ( see wxPerl image handling (short & sweet). )

Also, what you posted does not compile, besides extra newlines in your comments, there is odd  use colour qw( :everything );

Also, CUFP is for exibition, SOPW is for questions :) see Where should I post X?

Cheers


In reply to Re: Screen Capture via wxPerl Script by Anonymous Monk
in thread Screen Capture via wxPerl Script by jmlynesjr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.