ARKBreedingStats.ArkOCR.HasWhiteInVerticalLine C# (CSharp) Метод

HasWhiteInVerticalLine() приватный статический Метод

private static HasWhiteInVerticalLine ( Bitmap source, int posXInImage ) : bool
source System.Drawing.Bitmap
posXInImage int
Результат bool
        private static bool HasWhiteInVerticalLine(Bitmap source, int posXInImage)
        {
            bool hasWhite = false;
            if (posXInImage >= source.Width)
                return false;

            int greys = source.Height / 3;

            for (int h = 0; h < source.Height; h++)
            {
                if (source.GetPixel(posXInImage, h).R == 255)
                {
                    hasWhite = true;
                    break;
                }
                else if (source.GetPixel(posXInImage, h).R > 0)
                {
                    greys--;
                    if (greys == 0)
                    {
                        hasWhite = true;
                        break;
                    }
                }
            }
            return hasWhite;
        }