image manipulation using slider in iphone

后端 未结 3 1182
深忆病人
深忆病人 2021-01-26 07:21

Is there a way to apply brightness to uiimages. For example I have a UIImageview and inside that i have a uiimage. I want to manipulate its brightness with a help of UISlider wi

3条回答
  •  渐次进展
    2021-01-26 08:05

    here is the code:-

            CGImageRef inImage = currentImage.CGImage;
            CFDataRef ref = CGDataProviderCopyData(CGImageGetDataProvider(inImage)); 
            UInt8 * buf = (UInt8 *) CFDataGetBytePtr(ref); 
            int length = CFDataGetLength(ref);
            float value2 =  (1+slider.value-0.5);
            NSLog(@"%i",value);
            for(int i=0; i

    define this at the top:-

          #define SAFECOLOR(color) MIN(255,MAX(0,color))
    

提交回复
热议问题