Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Reading color from screen

Posted on 1997-07-17
2
Medium Priority
?
175 Views
Last Modified: 2012-05-04
Using Visual Basic 5, how can I find out what color is on
the screen at a certain coordinate, but not on a form that is part of my program, just at any given coordinate?
0
Comment
Question by:bryoung
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
W. Yang earned 100 total points
ID: 1428471
You need to know few api calls
GetDestopwindow: gives you the HWND of the desktop which is the screen.
GetDC: gives you the DC(a handle of a canvas) of the given HWND.
GetPixel: returns a colour of a point from the given DC.

If you know the DC of the current screen then you can use GetPixel(DesktopDC, X, Y) = a colour.

0
 

Author Comment

by:bryoung
ID: 1428472
I really need to know how to set up these API
calls, because I've never worked with them before.
This would have been a more helpful answer if I
had previous experience in setting up these API
calls, which I don't.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

610 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