tags:

views:

14

answers:

0

I'm a beginner .I want to get the half part of image. Actually I want to increase the the brighteness to half of the image using slider.

I know how to brighten full image. by using this code

-(UIImage *)colourize:(UIImage *)baseImage color:(UIColor *)theColor { UIGraphicsBeginImageContext(baseImage.size); CGContextRef ctx = UIGraphicsGetCurrentContext(); CGRect area = CGRectMake(0, 0, baseImage.size.width, baseImage.size.height); CGContextScaleCTM(ctx, 1, -1); CGContextTranslateCTM(ctx, 0, -area.size.height); CGContextSaveGState(ctx); CGContextClipToMask(ctx, area, baseImage.CGImage); [theColor set]; CGContextFillRect(ctx, area); CGContextRestoreGState(ctx); CGContextSetBlendMode(ctx, kCGBlendModeMultiply); CGContextDrawImage(ctx, area, baseImage.CGImage); UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return newImage; }