Hola Electro, Gracias por responder :p
Pero no me refiero a que busque un grado de "Coincidencia"
Mira es algo asi "pixel search and mouse click." algo relacionado con el "Auto-IT"
Pero en llegando al punto, este programa sera para un juego..
Esto es algo de codigo que he encontrado por hay en Google
public static Point PixelSearch(Rectangle rect, int PixelColor, int Shade_Variation)
{
Color Pixel_Color = Color.FromArgb(PixelColor);
Point Pixel_Coords = new Point(-1, -1);
Bitmap RegionIn_Bitmap = CaptureScreenRegion(rect);
BitmapData RegionIn_BitmapData = RegionIn_Bitmap.LockBits(new Rectangle(0, 0, RegionIn_Bitmap.Width, RegionIn_Bitmap.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int[] Formatted_Color = new int[3] { Pixel_Color.B, Pixel_Color.G, Pixel_Color.R }; //bgr
unsafe
{
for (int y = 0; y < RegionIn_BitmapData.Height; y++)
{
byte* row = (byte*)RegionIn_BitmapData.Scan0 + (y * RegionIn_BitmapData.Stride);
for (int x = 0; x < RegionIn_BitmapData.Width; x++)
{
if (row[x * 3] >= (Formatted_Color[0] - Shade_Variation) & row[x * 3] <= (Formatted_Color[0] + Shade_Variation)) //blue
{
if (row[(x * 3) + 1] >= (Formatted_Color[1] - Shade_Variation) & row[(x * 3) + 1] <= (Formatted_Color[1] + Shade_Variation)) //green
{
if (row[(x * 3) + 2] >= (Formatted_Color[2] - Shade_Variation) & row[(x * 3) + 2] <= (Formatted_Color[2] + Shade_Variation)) //red
{
Pixel_Coords = new Point(x + rect.X, y + rect.Y);
goto end;
}
}
}
}
}
}
end:
return Pixel_Coords;
}
private static Bitmap CaptureScreenRegion(Rectangle rect)
{
Bitmap BMP = new Bitmap(rect.Width, rect.Height, PixelFormat.Format24bppRgb);
Graphics GFX = System.Drawing.Graphics.FromImage(BMP);
GFX.CopyFromScreen(rect.X, rect.Y, 0, 0, rect.Size, CopyPixelOperation.SourceCopy);
return BMP;
}