| View previous topic :: View next topic |
| Author |
Message |
qallaf Guest
|
Posted: Sat Jun 30, 2007 4:43 am Post subject: PixelGetColor for other windows |
|
|
i want to make loop on that code but while i am in other window and maybe the color chages.....
that code is in window1 and when i make it loop on it and i am on window2
it dosent work!! coz PixelGetColor works for current window only
how to make PixelGetColor on window1 and while i am busy with window2
| Code: |
PixelGetColor, color, 625, 753
if (color = 0x393939)
{
MouseClick RIGHT, 877, 25
}
|
|
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 1121
|
Posted: Sat Jun 30, 2007 4:54 am Post subject: |
|
|
| I'm guesing the problem is that by default, PixelGetColor uses coordinates relative to the active window. So obviously if you make a different window active it will be messed up. You can use CoordMode Pixel, Screen to switch to coordinates relative to the screen, but you'll have to adjust your coordinates to compensate. However you should also be aware that if the pixel you need to check is covered by another window, you wont' be able to check it, at all. |
|
| Back to top |
|
 |
tic
Joined: 22 Apr 2007 Posts: 1786
|
Posted: Sat Jun 30, 2007 5:35 am Post subject: |
|
|
| you could do something ridiculous like work out the wanted windows relative position on the screen, so that you always know its coordinates rather than relative coordinates in the active window, so that when its inactive then you still know its last coordinates, and now for the ridicuolous part....make it so that a loop is formed with any window in z ordering above the specific window has a 1 pixel transparent dot at the part that is being checked? lol. would be complex code, but should work, and would also be a tiny bit messy that you would appear to have a dead pixel on your screen if there was anything over the wanted window |
|
| Back to top |
|
 |
qallaf Guest
|
Posted: Sat Jun 30, 2007 2:09 pm Post subject: |
|
|
| i want to do that plz |
|
| Back to top |
|
 |
svi
Joined: 09 Oct 2006 Posts: 236 Location: Finland
|
Posted: Sun Jul 01, 2007 6:57 pm Post subject: |
|
|
| qallaf wrote: | | i want to do that plz | So what's the problem?
If you want to check a pixel under a window / windows, then make the above window(s) "tranparent".
Value 255 means opaque (not at all tranparent / translucent), I think, but you can still get the pixel under such window(s).
| The Manual wrote: | | A window that is partially transparent or that has one of its colors marked invisible (TransColor) typically yields colors for the window behind itself rather than its own. |
_________________ Pekka Vartto |
|
| Back to top |
|
 |
tic
Joined: 22 Apr 2007 Posts: 1786
|
Posted: Mon Jul 02, 2007 1:26 am Post subject: |
|
|
| i dont think its quite as easy as that. you have to do this to only the windows above the one youre checking. it would be very complex code |
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 1121
|
Posted: Mon Jul 02, 2007 3:00 am Post subject: |
|
|
| You know, the reverse would be alot easier. Make the widnow you're interested in AlwaysOnTop, then hide everything but the one pixel you want to check using WinSet Region. |
|
| Back to top |
|
 |
Sukarn
Joined: 16 Jun 2007 Posts: 35
|
Posted: Mon Jul 02, 2007 8:47 am Post subject: |
|
|
| ManaUser wrote: | | You know, the reverse would be alot easier. Make the widnow you're interested in AlwaysOnTop, then hide everything but the one pixel you want to check using WinSet Region. |
I like that idea. |
|
| Back to top |
|
 |
svi
Joined: 09 Oct 2006 Posts: 236 Location: Finland
|
Posted: Mon Jul 02, 2007 9:47 am Post subject: |
|
|
| ManaUser wrote: | | ... the reverse would be alot easier. | Indeed!
Also having many transparent windows (even level 255) causes "performance penalty". Even one tranparency seems to be too much if the window in case is video window
But AlwaysOnTop is not always possible. At least I don't know a way to have WMP:s normal window on top of fullsreen WMP (in fullsreen mode there's really two WMP windows!). _________________ Pekka Vartto |
|
| Back to top |
|
 |
|