Feb 9, 2012

[How to] Color of A Point on The Screen

using System.Drawing;
using System.Drawing.Drawing2D;

Bitmap bitmap = new Bitmap(1, 1);
Graphics g = Graphics.FromImage(bitmap);


Give a point that you want
g.CopyFromScreen(this.Location, new Point(0, 0), new Size(1, 1));


This is what you needed
Color result = bitmap.GetPixel(0, 0);

No comments:

Post a Comment