简体   繁体   English

如何获取UIImage的Alpha

[英]How to get the alpha of an UIImage

I have a UIImage. 我有一个UIImage。 I need to find out its alpha value. 我需要找出它的alpha值。 Can someone explain it to me in detail, providing links to any references and also source code of how to go about this. 有人可以向我详细解释一下吗,提供指向任何参考的链接以及如何进行此操作的源代码。 Please don't provide answers for finding out the alpha of the UIImageView because I do NOT need that. 请不要提供找出UIImageView的Alpha的答案,因为我不需要它。 Thanks in advance 提前致谢

You have to obtain a CGImageRef . 您必须获取CGImageRef Once you have it you can use the method CGImageGetAlphaInfo that return the information of the alpha channel of the image. 有了它后,您可以使用方法CGImageGetAlphaInfo来返回图像的Alpha通道的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM