¡@

Home 

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

iphone Programming Glossary: cheight

layer.renderInContext doesn't take layer.mask into account?

http://stackoverflow.com/questions/4896296/layer-renderincontext-doesnt-take-layer-mask-into-account

saveImage UIImage saver nil CGImageRef image imageView.image.CGImage size_t cWidth CGImageGetWidth image size_t cHeight CGImageGetHeight image size_t bitsPerComponent 8 size_t bytesPerRow 4 cWidth Now we build a Context with those dimensions... 4 cWidth Now we build a Context with those dimensions. CGContextRef context CGBitmapContextCreate nil cWidth cHeight bitsPerComponent bytesPerRow CGColorSpaceCreateDeviceRGB CGImageGetBitmapInfo image The location where you draw your image.. size of the UIImage being show on the UIView. Hence the mod floats... CGContextDrawImage context CGRectMake 0 0 cWidth cHeight image float mod cWidth imageView.frame.size.width float modTwo cHeight imageView.frame.size.height Make the drawing right..