¡@

Home 

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

iphone Programming Glossary: mask.cgimage

iPhone development: pointer being freed was not allocated

http://stackoverflow.com/questions/1424210/iphone-development-pointer-being-freed-was-not-allocated

context2 1.0 1.0 Create masked overlay color layer CGImageRef MaskedImage CGImageCreateWithMask baseColor.CGImage mask.CGImage Draw the base color layer CGContextDrawImage context2 rect MaskedImage Get the result of the masking UIImage overlayMasked..

Round two corners in UIView

http://stackoverflow.com/questions/4847163/round-two-corners-in-uiview

CALayer layer layerMask.frame self.view.bounds Put the mask image as content of the layer layerMask.contents id mask.CGImage set the mask layer as mask of the view layer self.view.layer.mask layerMask Add a backaground color just to check if it..

iOS - How to achieve emboss effect for the text on UILabel?

http://stackoverflow.com/questions/8467141/ios-how-to-achieve-emboss-effect-for-the-text-on-uilabel

NO mask.scale UIColor blackColor setFill UIRectFill rect CGContextClipToMask UIGraphicsGetCurrentContext rect mask.CGImage CGContextClearRect UIGraphicsGetCurrentContext rect UIImage image UIGraphicsGetImageFromCurrentImageContext UIGraphicsEndImageContext.. Clip to the mask that only allows drawing inside the string's image. CGContextClipToMask gc rect mask.CGImage We apply the mask twice because we're going to draw through it twice. Only applying it once would make the edges too sharp... going to draw through it twice. Only applying it once would make the edges too sharp. CGContextClipToMask gc rect mask.CGImage mask nil done with mask let ARC free it Draw the red text. textColor setFill CGContextFillRect gc rect Draw the interior..

Draw glow around inside edge of multiple CGPaths

http://stackoverflow.com/questions/8480401/draw-glow-around-inside-edge-of-multiple-cgpaths

color. color setFill UIRectFill rect Now erase the masked part. CGContextClipToMask UIGraphicsGetCurrentContext rect mask.CGImage CGContextClearRect UIGraphicsGetCurrentContext rect UIImage image UIGraphicsGetImageFromCurrentImageContext UIGraphicsEndImageContext.. so I can restore the clip and shadow attributes after drawing. CGContextSaveGState gc CGContextClipToMask gc bounds mask.CGImage CGContextSetShadowWithColor gc offset blur color.CGColor invertedImage drawInRect bounds CGContextRestoreGState gc To test..