CaptchaRecogition.ImageProcess.GetStartBoundaryY C# (CSharp) Method

GetStartBoundaryY() public static method

Y轴开始的边界
public static GetStartBoundaryY ( Image img, int start ) : int
img Image
start int
return int
        public static int GetStartBoundaryY(Image img, int start)
        {
            Bitmap bmp = new Bitmap(img);
            int startB = 0;
            for (int i = start; i < bmp.Width; i++)
            {
                for (int j = 0; j < bmp.Height; j++)
                {
                    //遍历各个像素,获得bmp位图每个像素的RGB对象
                    Color pixelColor = bmp.GetPixel(i, j);
                    if (pixelColor.Name != "ffffffff")
                    {
                        startB = i;
                        break;
                    }
                }
                if (startB != 0)
                {
                    break;
                }
            }
            if (startB == start)
            {
                return startB + 2;
            }
            else
            {
                return startB - 1;
            }
        }