Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Returning the colour value of a pixel

Author
Message
Evarcha
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location: Preston, England
Posted: 20th May 2005 00:49
I am writing a program that loads in a picture but needs to print the colour value of the pixel that my mouse is pointed at, how would I go about it? also, is there a way of adding all 3 valuse up to be 1 long number so: rgb 150,150,150 would become 150150150.
Does this make sense? Thankyou to all that help and understand!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 20th May 2005 02:00
Try this. The 'color' number, is - by default - your 'added up long number.'



If you want a number like 128128128, then you would do something like this:
(red*1000000)+(green*1000)+blue

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II

Login to post a reply

Server time is: 2024-09-23 19:27:49
Your offset time is: 2024-09-23 19:27:49