zomit ara
zomit ara

Reputation: 13

How to get pixel colour in c#

I wanna make a program that will be able to get the color of a specific button on a different programs. so i need to get the pixel color of that button.*i don't have access on the files of the second application, so i cant make them communicate.

Every google search gave me nothing but endless hours of reading. Any ideas?

Upvotes: 0

Views: 266

Answers (1)

Arphile
Arphile

Reputation: 861

  1. Capture Current Screen and hold image in 'Bitmap'
  2. Get 'Current Mouse Location'
  3. Find 'Current Mouse Location' Pixel on 'Bitmap'
  4. Get Color on Pixel with this code

    'Bitmap'.GetPixel( 'MouseLocation'.X, 'MouseLocation'.Y);

Upvotes: 1

Related Questions