Author Topic: getPixelColor  (Read 4514 times)

I'm trying to figure out how this works. Using it gives incorrect results, unless im doing something wrong or the function is broken. How am i supposed to use it?

GuiBitmapCtrl::getPixelColor(x,y)
« Last Edit: November 04, 2014, 06:10:30 PM by Wrapperup »

This might help you.

I actually think GuiBitmapCtrl::getPixelColor is broken; I believe 0,0 is always 0,0 on your monitor regardless of the location of the bitmap control on your screen. Oddly enough it scans your screen to get the pixel instead of getting the pixel data from the image it contains, which is what the function implies from its name. I discovered this odd behavior with Trigun while trying to find a way to send image data across a connection (loading the image into a bitmap control then getting the color of each pixel and sending the color data).

After a bit of fiddling around, i managed to get it to work. Thanks!

This might help you.

Is he saying we can literally construct a full picture of the users monitor using getpixelcolor :V It seems to return a different result every time even though the pixel at 0,0 on my monitor is not changing color.
« Last Edit: November 04, 2014, 08:37:55 PM by Ipquarx »

Is he saying we can literally construct a full picture of the users monitor using getpixelcolor :V It seems to return a different result every time even though the pixel at 0,0 on my monitor is not changing color.

it appears to get it relative to the window. When doing a few tests and using the overlay, the resulting image got some pixel info from the overlay of steam.

Also, it appears that 0,0 is the bottom left of the screen. try placing a small swatch there to make sure and see what happens