开发者

Can i specify a color to be transparent

开发者 https://www.devze.com 2023-02-07 12:42 出处:网络
I have a UIImage, the background of it is white. I want the background of this UIImage to be tra开发者_如何学Cnsparent to its parent view. Is this possible?One word answer- No. As robin said you have

I have a UIImage, the background of it is white. I want the background of this UIImage to be tra开发者_如何学Cnsparent to its parent view. Is this possible?


One word answer- No. As robin said you have to use photo editing softwares to accomplish that. it cannot be done iphone(easily)..


I am not going to suggest that it is easy, but you should take a look at CGImageCreateWithMaskingColors, which is described in the Quartz 2D Programming Guide: Bitmap Images and Image Masks


You can't specify the transparency of a color from an image, but you could make a PNG image which has a transparency in the places you want it to be transparent.

0

精彩评论

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

关注公众号