Pixel Get Color in GDIP

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
ibieel
Posts: 216
Joined: 17 Oct 2021, 23:30

Pixel Get Color in GDIP

Post by ibieel » 23 Oct 2021, 20:40

hello guys, i'm studying a little bit of GDIP.

I've already learned how to search images with it (ImageSearch)
I've also learned how to search a pixel on the screen (PixelSearch)

but now i wanted to find the pixel color of a coordinate (GetPixelColor).
can someone help me with this code?
was thinking about something like this (but with GDIP):

Code: Select all

MouseGetPos, MouseX, MouseY
PixelGetColor, ColorID, %MouseX%, %MouseY%
ToolTip, %ColorID%

User avatar
boiler
Posts: 16914
Joined: 21 Dec 2014, 02:44

Re: Pixel Get Color in GDIP

Post by boiler » 23 Oct 2021, 21:47

If you have been using the AHK GDIP library, then you should have been able to find Gdip_GetPixel().

User avatar
ibieel
Posts: 216
Joined: 17 Oct 2021, 23:30

Re: Pixel Get Color in GDIP

Post by ibieel » 23 Oct 2021, 23:03

boiler wrote:
23 Oct 2021, 21:47
If you have been using the AHK GDIP library, then you should have been able to find Gdip_GetPixel().
Oh yes, I found it.
He seems to be working, but is returning the value into a format I do not know. Looks like:
"21687651659"

I usually see the colors in formats:
0xFF112233

User avatar
boiler
Posts: 16914
Joined: 21 Dec 2014, 02:44

Re: Pixel Get Color in GDIP

Post by boiler » 24 Oct 2021, 07:49

You are just seeing the decimal representation of the value instead of the hex value. You can display the hex value if you want, but typically that’s not necessary. If you just want to compare it to a value that you express in hex, then it will match if the color is indeed the same.

Post Reply

Return to “Ask for Help (v1)”