¡@

Home 

2014/10/15 ¤U¤È 10:11:45

iphone Programming Glossary: myiconimage.cgimage

How to tint a transparent PNG image in iPhone?

http://stackoverflow.com/questions/3514066/how-to-tint-a-transparent-png-image-in-iphone

context rect draw original image CGContextSetBlendMode context kCGBlendModeNormal CGContextDrawImage context rect myIconImage.CGImage tint image loosing alpha the luminosity of the original image is preserved CGContextSetBlendMode context kCGBlendModeColor.. alpha values of original image CGContextSetBlendMode context kCGBlendModeDestinationIn CGContextDrawImage context rect myIconImage.CGImage If your image has no half transparent pixels you could also do it the other way around with kCGBlendModeLuminosity draw.. of background ignoring alpha CGContextSetBlendMode context kCGBlendModeLuminosity CGContextDrawImage context rect myIconImage.CGImage mask by alpha values of original image CGContextSetBlendMode context kCGBlendModeDestinationIn CGContextDrawImage context..