public static bool IsAlphaBitmap(Bitmap bmp, out BitmapData bmpData)
{
var bmBounds = new Rectangle(0, 0, bmp.Width, bmp.Height);
bmpData = bmp.LockBits(bmBounds, ImageLockMode.ReadOnly, bmp.PixelFormat);
try
{
byte[] bytes = new byte[bmpData.Height * bmpData.Stride];
Marshal.Copy(bmpData.Scan0, bytes, 0, bytes.Length);
for (var p = 3; p < bytes.Length; p += 4) {
if (bytes[p] != 255) return true;
}
}
finally
{
bmp.UnlockBits(bmpData);
}
return false;
}