Esempio n. 1
0
 public virtual bool HasColor(int[] color, int[] threshold)
 {
     for (int y = 0; y < bmp.Height; y++)
     {
         for (int x = 0; x < bmp.Width; x++)
         {
             if (FastBitmap.PixelEqual(color, this.GetPixel(x, y), threshold))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Esempio n. 2
0
        public virtual int CountColor(int[] color, int[] threshold)
        {
            int count = 0;

            for (int y = 0; y < bmp.Height; y++)
            {
                for (int x = 0; x < bmp.Width; x++)
                {
                    if (FastBitmap.PixelEqual(color, this.GetPixel(x, y), threshold))
                    {
                        count++;
                    }
                }
            }
            return(count);
        }