Jump to content

What does PixelGetColor actually do?


Recommended Posts

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?

Link to comment
Share on other sites

  • 3 months later...

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
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...