?
Solved

Get Screen color @ curr mouse pos

Posted on 1999-10-28
7
Medium Priority
?
228 Views
Last Modified: 2010-04-04
Hi ! How do I get the color at the current mouse position (global) ?
How to convert it to RGB value ?

regards
ItsMe
0
Comment
Question by:ItsMe
7 Comments
 
LVL 2

Expert Comment

by:rene100
ID: 2167312
Hi

don't know if there is an easier soltution, but this one should work: Get the mouse coordinates with GetCursorPos, then copy the screen to a tbitmap and get the color with the canvas.pixels property..this sould be a rgb-value

regards
rene
0
 
LVL 2

Accepted Solution

by:
CalvinDay earned 120 total points
ID: 2167448
use

function Pixel(x,y:integer):integer;
var
dc:HDC;
begin
  dc:=GetDC(0);
  GetPixel(dc,x,y);
  ReleaseDC(0,dc);
end;
0
 
LVL 2

Expert Comment

by:CalvinDay
ID: 2167452
Sorry: should read Result:=GetPixel(dc,x,y);
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
LVL 3

Expert Comment

by:bryan7
ID: 2168013
listenning
0
 
LVL 15

Expert Comment

by:simonet
ID: 2168594
Following...®
0
 

Author Comment

by:ItsMe
ID: 2172376
it works pretty cool. this was a good idea...

regards
ItsMe
0
 
LVL 2

Expert Comment

by:CalvinDay
ID: 2174249
Thanks.
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
Suggested Courses
Course of the Month6 days, 6 hours left to enroll

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question