Jonathan.
Jonathan.

Reputation: 55574

working with PNGs in vb.net

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.

Upvotes: 0

Views: 352

Answers (1)

Chris Haas
Chris Haas

Reputation: 55437

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

Upvotes: 1

Related Questions