SimplyKiwi
SimplyKiwi

Reputation: 12444

Getting transparent pixels in UIImage

I am looking for a way to get the transparent pixels in a UIImage, I have googled this but have found little or nothing. Does anyone know how I can do this? I am looking for the easiest way possible too!

Thanks!

Upvotes: 0

Views: 643

Answers (1)

margusholland
margusholland

Reputation: 3348

If you initialize an UIImage with a transparent or semitransparent image form disk, all the pixels that were transparent, still remain transparent. What is it that you actually want to achieve, maybe I’m misunderstanding something.

Anyway, just save a transparent image (PNG would probably be best) to disk, add it to XCode project and then just:

something = [UIImage imageNamed:@"some.png"];

Has worked fine for me so far.

Upvotes: 1

Related Questions