我需要确定图像是否包含特定颜色:
r:255
g:0
b:192
我找到了这个,但是如果图像包含上述颜色,我需要返回一个布尔值,而不是返回点。
public static List<Point> FindAllPixelLocations(this Bitmap img, Color color)
        {
            var points = new List<Point>();
            int c = color.ToArgb();
            for (int x = 0; x < img.Width; x++)
            {
                for (int y = 0; y < img.Height; y++)
                {
                    if (c.Equals(img.GetPixel(x, y).ToArgb())) points.Add(new Point(x, y));
                }
            }
            return points;
        }