- (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 ?