Pixel color?

Is there a way to get the color (rgb/hex) of a certain pixel on the screen (not from an image!)? For example, if I want to know the color of the pixel at the x/y coordinates 1000, 1000, how would I do this?

I want to explore this idea for Citrix automation because images can be a bit funky.

1 Like

Try this, although I did it from the image but from current screen.

Actually @andrzej.kniola worked on something similar few weeks back. He may be able to help.

pixel.xaml (7.5 KB)

Hey @trog

Yeah
Try with this Nuget Package and let me know :slight_smile:
ForumGetPixalColorValueActivities.1.0.0.nupkg (4.9 KB)

and with Bitmap easy functions are available so u can use that use as well but as you mentioned not from image so try with that nuget.

@vvaidya sample will do the same will take the existing screen screenshot and then by using BItmap class get the Pixel things :slight_smile:

Regards…!!
Aksh

1 Like

Hey,

Thanks for the answers! I don’t know what to do with a Nuget package :upside_down_face: and I want to avoid the Take Screenshot activity if possible. I was playing around and managed to come up with a workflow file that does exactly what I want using VB .Net code.

It’s a workflow that accepts X and Y coordinates, a pixel color (hex format, example: “0173C7”) and timer in seconds as arguments. It returns a boolean to indicate if the pixel color was found at the coordinates within the alotted time. It’s very responsive despite polling the screen every second.

The main purpose I see for this is to check if a web application loaded (through Citrix or similar env). I wonder how reliable this would be compared to searching for images. What do you think?

WaitForPixelColor.xaml (10.1 KB)

You can install it from package manager.
If you have no clue den search on the forum :slight_smile:

once you will install the above package you will get the activity in the activities pane.
image

This activity will take two input arguments from user i.e. X and Y coordinates.

image

For example if you will pass X=1000 and Y=2000 then you will get following Hexadecimal color string/

image

i was not aware with your main purpose :stuck_out_tongue:

Regards…!!
Aksh

1 Like

It works :grinning:, thanks @aksh1yadav

How to find X and Y coordinates