¡@

Home 

2014/10/15 ¤U¤È 10:05:01

iphone Programming Glossary: cgcontextsetblendmode

Retrieving a pixel alpha value for a UIImage

http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage

coordinates and Core Graphics coordinates. However after setting the blend mode my alpha values were what I expected CGContextSetBlendMode context kCGBlendModeCopy iphone uikit core graphics quartz graphics share improve this question Yes CGContexts have.. before drawing the image since you want the image's alpha value not the one which was in the context's buffer before CGContextSetBlendMode context kCGBlendModeCopy Edit after thinking You could do the lookup much more efficient by building the smallest possible..

How would I tint an image programatically on the iPhone?

http://stackoverflow.com/questions/1117211/how-would-i-tint-an-image-programatically-on-the-iphone

self.image.CGImage Blend mode could be any of CGBlendMode values. Now draw filled rectangle over top of image. CGContextSetBlendMode context kCGBlendModeMultiply CGContextSetFillColor context CGColorGetComponents self.overlayColor.CGColor CGContextFillRect..

iPhone - How do you color an image?

http://stackoverflow.com/questions/1223340/iphone-how-do-you-color-an-image

ctx CGContextClipToMask ctx area baseImage.CGImage theColor set CGContextFillRect ctx area CGContextRestoreGState ctx CGContextSetBlendMode ctx kCGBlendModeNormal CGContextDrawImage ctx area baseImage.CGImage UIImage newImage UIGraphicsGetImageFromCurrentImageContext.. else UIGraphicsBeginImageContext self.size self drawInRect rect CGContextRef context UIGraphicsGetCurrentContext CGContextSetBlendMode context kCGBlendModeSourceIn CGContextSetFillColorWithColor context color.CGColor CGContextFillRect context rect UIImage..

blend two uiimages

http://stackoverflow.com/questions/1309757/blend-two-uiimages

0 0 320 480 This is my bkgnd image CGContextDrawImage context bounds UIImage imageNamed @ bkgnd.jpg .CGImage CGContextSetBlendMode context kCGBlendModeSourceIn This is my image to blend in CGContextDrawImage context bounds UIImage imageNamed @ over.png..

Drawing incrementally in a UIView (iPhone)

http://stackoverflow.com/questions/1798414/drawing-incrementally-in-a-uiview-iphone

context self.bounds maskRef draw the mask CGContextClipToMask context self.bounds maskRef respect alpha mask CGContextSetBlendMode context kCGBlendModeColorBurn set blending mode for Drop drop in myPoints CGContextAddEllipseInRect context CGRectMake drop.point.x.. context CGContextRef context UIGraphicsGetCurrentContext CGContextDrawImage context self.bounds maskRef draw the mask CGContextSetBlendMode context kCGBlendModeColorBurn set blending mode cachedImage drawAtPoint CGPointZero draw the cached image EDIT After all.. context self.bounds maskRef draw the mask CGContextClipToMask context self.bounds maskRef respect alpha mask CGContextSetBlendMode context kCGBlendModeColorBurn set blending mode if myPoints count 0 Drop drop myPoints objectAtIndex myPoints count 1 CGPathAddEllipseInRect..

How to tint a transparent PNG image in iPhone?

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

for tinting a transparent image with kCGBlendModeColor draw black background to preserve color of transparent pixels CGContextSetBlendMode context kCGBlendModeNormal UIColor blackColor setFill CGContextFillRect context rect draw original image CGContextSetBlendMode.. context kCGBlendModeNormal UIColor blackColor setFill CGContextFillRect context rect draw original image CGContextSetBlendMode context kCGBlendModeNormal CGContextDrawImage context rect myIconImage.CGImage tint image loosing alpha the luminosity of.. context rect myIconImage.CGImage tint image loosing alpha the luminosity of the original image is preserved CGContextSetBlendMode context kCGBlendModeColor tintColor setFill CGContextFillRect context rect mask by alpha values of original image CGContextSetBlendMode..