Sign in to follow this  
Followers 0
Xenthalon

What does PixelGetColor actually do?

4 posts in this topic

I know it gives out the Pixelcolor and I am using it quite often in a program I am improving at the moment. I do about 180 PixelGetColors on the exact same image several times a second. I am using the autoit dll in my c++ script, and the program runs fine on my main computer here, but on my slower laptop this takes significantly more time.

So what is PixelGetColor actually doing?

Does it take a screenshot of the specified area (whole screen, window, client area) and then does one PixelGetColor on it? If this were the case I would have to write my own version which takes a screenshot once and then checks the colors. I suppose this would improve perfomance a lot.

Or is it getting the color directly from the framebuffer from something like DirectX or your graphics card?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

calls Win API... GetPixel()

Lar.

Hi Lar im a newbie in AUtoit, so could you write an example of Dllcall for getpixel() API function?

I'v try with these but i didnt sussceeded:

$handle = WinGetHandle("wintitle")

$hdc = DllCall("user32.dll","int","GetDC","hwnd",$handle)

$result= DllCall ("gdi32.dll", "long", "GetPixel", "long", $dc, "long", $x, "long", $y)

is that right?

if you dont mind, please write an example to display color at the current mouse pos of an window application

Thanks N best regards

Edited by spymoon

Share this post


Link to post
Share on other sites

That's what you get for using Vista, Jon.

Share this post


Link to post
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
Sign in to follow this  
Followers 0