objective c - How to tell if PNG file has an Alpha Channel / Transparency -


trying find best / easiest way using objective c on mac osx if png file has alpha channel.

here's 1 way:

nsbitmapimagerep *rep = [nsbitmapimagerep imagerepwithcontentsoffile:@"/path/to/image/test.png"]; bool alpha = [rep hasalpha]; 

Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

php - Improving script execution time -

How to provide Authorization & Authentication using Asp.net, C#? -