AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PixelColor

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Mayhem



Joined: 21 Aug 2004
Posts: 104

PostPosted: Sat Aug 21, 2004 12:49 am    Post subject: PixelColor Reply with quote

I'm trying to get the pixel color of an inactive window.

This window is completely showing, but I have something else running that needs the focus instead (100%) of the time.

Can someone give me a quick example how this can be done?

I'm assuming i'll have to change my coord mode for mouse and pixel to "screen". I just don't know how to get the "X,Y" of the inactive screen and mousemove / get color inside it (without using relative coord mode).

Please help!

Thanks
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5009
Location: imaginationland

PostPosted: Sat Aug 21, 2004 1:28 am    Post subject: Answer... Reply with quote

Go here, I think you might find it useful: Arrow http://www.autohotkey.com/docs/commands/PixelGetColor.htm
Back to top
View user's profile Send private message Visit poster's website
Mayhem



Joined: 21 Aug 2004
Posts: 104

PostPosted: Sat Aug 21, 2004 1:38 am    Post subject: Reply with quote

I've read through that ..

That requires the window to be in focus. I'm trying to get the color without it being in focus.

Thank anyways tho.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Sat Aug 21, 2004 1:49 am    Post subject: Reply with quote

If the inactive window is always in the same place on the screen, you don't need to do anything other than switch to screen coordinates:

CoordMode, Pixel, Screen

However, if it's position varies, use WinGetPos to help convert the relative coordinates of the target pixel (which are constant) to screen coordinates (which vary depending on the position of the window's upper-left corner):

WinGetPos, iax, iay, , , WinTitle
; Convert from relative to absolute/screen:
iax += 150 ; In this example, 150 is the known relative x position
iay += 100 ; And 100 is the relative Y position (also constant)
CoordMode, Pixel, Screen
PixelGetColor, color, %iax%, %iay%
Back to top
View user's profile Send private message Send e-mail
Mayhem



Joined: 21 Aug 2004
Posts: 104

PostPosted: Sat Aug 21, 2004 4:43 am    Post subject: Reply with quote

Thank you chris!

This is exactly what i was looking for!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group