Answers for "{ graphics.CopyFromScreen(position, new Point(x, y), new Size(50, 50)); } return bitmap.GetPixel(0, 0);"

C#
0

get color of pixel c#

static Color GetPixel(Point position)
{
	using (var bitmap = new Bitmap(1, 1))
	{
        using (var graphics = Graphics.FromImage(bitmap))
        {
            graphics.CopyFromScreen(position, new Point(0, 0), new Size(1, 1));
        }
    	return bitmap.GetPixel(0, 0);
	}
}
Posted by: Guest on December-10-2020

Code answers related to "{ graphics.CopyFromScreen(position, new Point(x, y), new Size(50, 50)); } return bitmap.GetPixel(0, 0);"

C# Answers by Framework

Browse Popular Code Answers by Language