Hi it's me again :P I found a way how to get that working. at this moment code is very primitive, but it do what i want. ofc ill post the code below, because maybe someone may need it, and will modify it by himself. This is my first week with perl (and i don't know any other programming language). I have to say it again it's VERY PRIMITIVE JUST FOR TEST. GOTO made code slower. Just put it here, to check if it's works.
use Imager; use Imager::Screenshot 'screenshot'; use Win32::GuiTest qw(FindWindowLike GetWindowText SetForegroundWindow SendKeys); START: my $img = screenshot(); #make screenshot $img->write(file => 'screenshot.png', type => 'png' ) || print "Failed: ", $img->{ERRSTR} , "\n"; #write a new sreenshot o +ver old one #or send error $img=Imager->new(); #make new image $img->read(file=>'screenshot.png',type=>'png'); #read from fresh scre +enshot $color = $img->getpixel(x=>68, y=>58); #get pixel from coord +inate x,y $img1=Imager->new(); #make new image $img1->read(file=>'orginal.png',type=>'png'); #1.read from orginal +pcitrue i have made $color1 = $img1->getpixel(x=>68, y=>58); #2. before to compar +e element from $keys = (22); #3. the same coordina +tes, so when #4. window is change +on any diferent color #5. program show doin + code (else) if ($color->equals(other=>$color1)) { #if color is the same print "ok\n" #print ok, do nothing. } else { #else press key 22 from $key +s SendKeys ($keys, 100) } sleep 1; #sleep for one sec goto START; #go back and do compare aga +in with new screenshot

In reply to Re: How to get pixel color from 3d application by JuR
in thread How to get pixel color from 3d application by JuR

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.