private static int GetEndBoundaryX(Image img, int startX, int startY, int endY)
{
Bitmap bmp = new Bitmap(img);
int endB = 0;
for (int i = startX + 1; i < bmp.Height; i++)
{
int cnt = 0;
for (int j = startY; j < endY; j++)
{
//遍历各个像素,获得bmp位图每个像素的RGB对象
Color pixelColor = bmp.GetPixel(j, i);
if (pixelColor.Name == "ffffffff")
{
cnt++;
continue;
}
else
break;
}
if (cnt == endY - startY&&i-startX>4)//防止把i的点也算进去
{
endB = i;
break;
}
}
return endB;
}