mIRC Home    About    Download    Register    News    Help

Print Thread
Getting a pixel's color value #165356 25/11/06 07:05 PM
Joined: Jan 2006
Posts: 64
S
SoundreameR Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jan 2006
Posts: 64
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

Re: Getting a pixel's color value #165357 26/11/06 12:48 PM
Joined: Mar 2003
Posts: 612
B
billythekid Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
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


billythekid
Re: Getting a pixel's color value #165358 26/11/06 03:28 PM
Joined: Jan 2006
Posts: 64
S
SoundreameR Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jan 2006
Posts: 64
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

Re: Getting a pixel's color value #165359 26/11/06 05:39 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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)

Re: Getting a pixel's color value #165360 26/11/06 06:00 PM
Joined: Jan 2006
Posts: 64
S
SoundreameR Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jan 2006
Posts: 64
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

Re: Getting a pixel's color value #165361 26/11/06 06:15 PM
Joined: Mar 2003
Posts: 612
B
billythekid Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
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


billythekid
Re: Getting a pixel's color value #165362 26/11/06 11:15 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
mahahahahaha I doubt it! But Double points for the idea!

Re: Getting a pixel's color value #165363 26/11/06 11:20 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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)