Jump to content

Problem with pixel/color search functions


Elettrone
 Share

Recommended Posts

I made a plugin for a game and i've been using the PixeGetColor() and PixelSearch() functions in a tight loop to understand when the interfaces changes.

The problem is that for some reason, these functions detect black pixels(with color value=0) even if there are none and this is causing me a lot of trouble.

It looks like it happens a LOT more on ATI cards....is this a know issue or what?

Link to comment
Share on other sites

Well, I believe that the underlying cause of this is because PixelGetColor and PixelSearch both use GDI. You're probably reading from a window that is drawing itself using DirectX technology. DirectX and GDI are completely seperate drawing methods in Windows, and they're not ment to be interacting the way most AutoIt users are using it.

We're all rather lucky that it is working at all...

Link to comment
Share on other sites

i Found out a similiar problem on a game called combat arms... then i noticed that for some weird reason if i moved the mouse to o,o coords Before checking the color of the pixel, Strangely the color will be the real one.... i dunno if this is the same as my problem but u can try to add this before ur pixel get color...

Mousemove(0,0,300)... try it and let me know if it worked, if not maybe we will find another logistic u can use maybe...

Link to comment
Share on other sites

Well, I believe that the underlying cause of this is because PixelGetColor and PixelSearch both use GDI. You're probably reading from a window that is drawing itself using DirectX technology. DirectX and GDI are completely seperate drawing methods in Windows, and they're not ment to be interacting the way most AutoIt users are using it.

We're all rather lucky that it is working at all...

You're telling me there's no actual solution to this problem?! That can't be true.... T_T

Would it change anything if i ran the program under OpenGL rather than DirectX? I know this game can also run with OGL.

i Found out a similiar problem on a game called combat arms... then i noticed that for some weird reason if i moved the mouse to o,o coords Before checking the color of the pixel, Strangely the color will be the real one.... i dunno if this is the same as my problem but u can try to add this before ur pixel get color...

Mousemove(0,0,300)... try it and let me know if it worked, if not maybe we will find another logistic u can use maybe...

Actually my check points are fixed, i don't use the mouse cursor to find my colors...

I've partially fixed this issue introducing data buffering and data filtering....but this offcourse also introduces some lag on responsivness....necessary to avoid false positives; still i'm not satisfied....i want to go to the source of the problem...

Is there ANY other option lying around?

Edited by Elettrone
Link to comment
Share on other sites

if u use the function pixel get color, as i said above try to make it like i said

Mousemove(0,0,500)

Pixelgetcolor(x,y)

it worked for me and i had ur same issue so before saying all that you should give it a try...

Actually that won't work for me :D

I check pixels 20-40 times a second...

I wonder if autohotkey has a better solution for this...

Thanks anyway.

Link to comment
Share on other sites

Actually that won't work for me :D

I check pixels 20-40 times a second...

I wonder if autohotkey has a better solution for this...

Thanks anyway.

if u check pixel 20 40 times, just keep the mouse there untill u finish checking ur pixels then u can move it... well i just know this way to make it work so at least i tried to help ^^
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...