Ada*_*m P 18
为什么不循环遍历图像中的所有像素并检查它们的alpha值?
bool ContainsTransparent(Bitmap image)
{
for (int y = 0; y < image.Height; ++y)
{
for (int x = 0; x < image.Width; ++x)
{
if (image.GetPixel(x, y).A != 255)
{
return true;
}
}
}
return false;
}
Run Code Online (Sandbox Code Playgroud)