Question

I have PNG and need to know if it has an alpha (or if the alpha is completely white)? How can I accomplish this in vb.net code.

Was it helpful?

Solution

Use System.Drawing.Image.Flags:

    Dim HasAlpha As Boolean
    Using I = System.Drawing.Image.FromFile("c:\test.png")
        HasAlpha = (I.Flags And System.Drawing.Imaging.ImageFlags.HasAlpha) = System.Drawing.Imaging.ImageFlags.HasAlpha
    End Using
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top