Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7679605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:54:59+00:00 2026-05-31T17:54:59+00:00

I need my program to see different colors. Pretty much all I need is

  • 0

I need my program to “see” different colors.

Pretty much all I need is a function which tells the color of a single pixel on my screen by using the x-coordinate and the y-coordinate. I hope there is a function like that 😛

Coordinates go in.

string color;
TellColor(126, 1024, color);
cout << color;

Color comes out.
Green

I did some searching though and I found a great function called GetPixel, but as far as I can know it can only tell colors from a image file. Correct me if I’m wrong.

Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:55:00+00:00Added an answer on May 31, 2026 at 5:55 pm

    hope it help

    The GetPixel function retrieves the red, green, blue (RGB) color value of the
    pixel at the specified coordinates.

    COLORREF GetPixel(
    
        HDC hdc,    // handle of device context  
        int XPos,   // x-coordinate of pixel 
        int nYPos   // y-coordinate of pixel 
       );   
    

    Parameters

    hdc
    

    Identifies the device context.

    nXPos
    

    Specifies the logical x-coordinate of the pixel to be examined.

    nYPos
    

    Specifies the logical y-coordinate of the pixel to be examined.

    Return Values

    If the function succeeds, the return value is an RGB value. If the pixel is outside of the
    current clipping region, the return value is CLR_INVALID.
    Remarks

    The pixel must be within the boundaries of the current clipping region.
    Not all devices support GetPixel. An application should call GetDeviceCaps to determine
    whether a specified device supports this function.

    See Also

    GetDeviceCaps, SetPixel
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need my program to create and edit a config file, which would contain
I need my program to show different parts of the data contained in a
I have a function that - as a larger part of a different program
I need a function in MySQL which will evaluate a status code... In my
I need my program to work only with certain USB Flash drives (from a
My current program need to use programatically create a XPathExpression instance to apply to
I need to generate multiple databases to SQL, so I need script/program to automatically
I'm doing a theatrical performance, and I need a program that can read images
In my program I need to programmatically configure an ApplicationContext. Specifically, I have a
In my program I need a way to click on an Image control, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.