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 / Get the RGB colour from a specific X,Y location on the screen.

Author
Message
Colin Hart
21
Years of Service
User Offline
Joined: 28th Apr 2003
Location: United Kingdom
Posted: 27th Jun 2005 03:25
Hi all.

I need to extract the rgb value from the screen at a given x,y spot. Can anyone help?

I have been looking a RGBR,RGBG ect... but i'm failing to see how these can be used to interact with the screen..

Regards


Colin.
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 27th Jun 2005 03:40
Colin Hart,

Look into the help files, under BASIC 2D, and you will find the point(x,y) command. This will return the color value of a given point.


+NanoBrain+
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 27th Jun 2005 03:53
If you have Dark Basic Professional then this is a very simple task to achieve.



There's a minor issue with my code, so try not to go offscreen with the pixel box; because it'll crash. Reason is the Pixel Buffer is trying to write to memory that doesn't exist, it's quite easily correctly but not quickly.

It should give you a good idea of how you can use the pixels though.

Login to post a reply

Server time is: 2024-09-23 23:24:54
Your offset time is: 2024-09-23 23:24:54