开发者

Getting transparent pixels in UIImage

开发者 https://www.devze.com 2023-03-12 10:53 出处:网络
I am looking for a way to get the transparent pixels in a UIImage, I have googled this 开发者_Go百科but have found little or nothing. Does anyone know how I can do this?

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

Thanks!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消