0
- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{


    NSSet *allTouches = [[event allTouches] retain];
    switch ([allTouches count])
    {
           case 1: {
           UITouch *touch = [[allTouches allObjects] objectAtIndex:0];
           CGPoint touchPoint =  [touch locationInView:[self view]];
                if(touchPoint.x > rightleg.frame.origin.x && touchPoint.x < rightleg.frame.origin.x + rightleg.frame.size.width &&
                   touchPoint.y > rightleg.frame.origin.y && touchPoint.y < rightleg.frame.origin.y + rightleg.frame.size.height ){
                   rightleg.alpha = rightleg.alpha + 0.005;
                }
            }
        case 2 :{
            UITouch *touch = [[allTouches allObjects] objectAtIndex:0];
            CGPoint touchPoint =  [touch locationInView:[self view]];
            if(touchPoint.x > leftleg.frame.origin.x && touchPoint.x < leftleg.frame.origin.x + leftleg.frame.size.width &&
               touchPoint.y > leftleg.frame.origin.y && touchPoint.y < leftleg.frame.origin.y + leftleg.frame.size.height ){
               leftleg.alpha = leftleg.alpha + 0.005;

            }
        }
    }


}

this code is set alpha on UIImage when user touches on Image, but How to set alpha on the pixel in UIImage when touches on that pixel ?

sarak
  • 91
  • 10

1 Answers1

0

You would have to convert your UIImage to a bytes array, make the changes and then save to an UIImage again.

Something like this might help:

Community
  • 1
  • 1
ferostar
  • 7,074
  • 7
  • 38
  • 61