¡@

Home 

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

iphone Programming Glossary: mainviewcontentcontext

Cropping image with transparency in iPhone

http://stackoverflow.com/questions/10810798/cropping-image-with-transparency-in-iphone

CGColorSpaceRef colorSpace CGColorSpaceCreateDeviceRGB CGImageRef maskImageRef maskImage CGImage CGContextRef mainViewContentContext CGBitmapContextCreate NULL maskImage.size.width maskImage.size.height 8 0 colorSpace kCGImageAlphaPremultipliedLast if mainViewContentContext.. CGBitmapContextCreate NULL maskImage.size.width maskImage.size.height 8 0 colorSpace kCGImageAlphaPremultipliedLast if mainViewContentContext NULL return NULL CGFloat ratio 0 ratio maskImage.size.width image.size.width if ratio image.size.height maskImage.size.height.. 2 image.size.height ratio maskImage.size.height 2 image.size.width ratio image.size.height ratio CGContextClipToMask mainViewContentContext rect1 maskImageRef CGContextDrawImage mainViewContentContext rect2 image.CGImage CGImageRef newImage CGBitmapContextCreateImage..

UIImage rounded corners

http://stackoverflow.com/questions/262156/uiimage-rounded-corners

scaledHeight 0.5 else if widthFactor heightFactor thumbnailPoint.x targetSize.width scaledWidth 0.5 CGContextRef mainViewContentContext CGColorSpaceRef colorSpace colorSpace CGColorSpaceCreateDeviceRGB create a bitmap graphics context the size of the image.. colorSpace colorSpace CGColorSpaceCreateDeviceRGB create a bitmap graphics context the size of the image mainViewContentContext CGBitmapContextCreate NULL targetSize.width targetSize.height 8 0 colorSpace kCGImageAlphaPremultipliedLast free the rgb.. 8 0 colorSpace kCGImageAlphaPremultipliedLast free the rgb colorspace CGColorSpaceRelease colorSpace if mainViewContentContext NULL return NULL CGContextSetFillColorWithColor mainViewContentContext UIColor whiteColor CGColor CGContextFillRect mainViewContentContext..

Rendering UIView with its children

http://stackoverflow.com/questions/788662/rendering-uiview-with-its-children

subviews. I'd like to get a snapshot image of it using renderInContext or other method. clefView.layer renderInContext mainViewContentContext If I pass it my UIView as above then I get a blank bitmap. None of the children are rendered into the bitmap. If I pass..