private static int GetStartBoundaryX(Image img, int startY, int endY)
{
Bitmap bmp = new Bitmap(img);
int startB = 0;
for (int i = 0; i < img.Height; i++)
{
for (int j = startY; j < endY; j++)
{
//遍历各个像素,获得bmp位图每个像素的RGB对象
Color pixelColor = bmp.GetPixel(j, i);
if (pixelColor.Name != "ffffffff")
{
startB = i;
break;
}
else
continue;
}
if (startB != 0)
{
break;
}
else
continue;
}
return startB - 1;
}