mIRC Homepage

Getting a pixel's color value

Posted By: SoundreameR

Getting a pixel's color value - 25/11/06 07:05 PM

Any ideas how to get the color value of a specific pixel on the screen (non mIRC window, so $getdot won't do the trick)? smile
Posted By: billythekid

Re: Getting a pixel's color value - 26/11/06 12:48 PM

all i could suggest is scripting a screen dump, saving to a temp.bmp, loading that in a custom window and grabbing your pixel from there...(I'm not even going to attempt the logarithm for finding a specific pixel)...then .remove temp.bmp

i know its a bit of a roundabout way to go but it's all i can think of.

btk
Posted By: SoundreameR

Re: Getting a pixel's color value - 26/11/06 03:28 PM

I was thinking about this, but saving to bmp may change the color value of some pixels, because of the quality of the bmp file format... I need the exact color value not +/- 10 of 16 000 000
Posted By: DaveC

Re: Getting a pixel's color value - 26/11/06 05:39 PM

BMP files dont go off by +/-10 there 24 or 32 bit what ever the image is you got (8 bit if your in some old 256 color screen mode tho)
Posted By: SoundreameR

Re: Getting a pixel's color value - 26/11/06 06:00 PM

Aham... right... but what I need is a script which will be executed each second, so therefor it must be fast and simple to compile by mIRC, so that my CPU stays cool... the screenshot idea is a possibility... but it would be very inefficient to generate a map of 1028x1024 pixels to get the color value of one single pixel on the screen, in order to analyse the movement of an object in another program... frown
Posted By: billythekid

Re: Getting a pixel's color value - 26/11/06 06:15 PM

i dont know if this is any good, but if a custom window were opened, maximised on the desktop with a transparency of 100% would the pixel colours be available then?

btk
Posted By: DaveC

Re: Getting a pixel's color value - 26/11/06 11:15 PM

mahahahahaha I doubt it! But Double points for the idea!
Posted By: DaveC

Re: Getting a pixel's color value - 26/11/06 11:20 PM

Well i never was the one who said it would be fast smile
Also didnt realize you were after realtime tracking of soemthng small,
I thought it was more a need to pull the pixel colors of another screen off, like u wanted to build the whole picture (or part of) up in something else, then it would have been fine, just screen cap, drop the whole bmp in a picwin and cut out the chunk u want.

Im sure some of the dll writers around could bang up soemthing that well access the screen x,y direct and return a pixel color, but im not one of them,

(/me is to lazy to sort out why .net wouldnt work with mirc when i tried, and never tried again)
© 2020 mIRC Discussion Forums