Doing a smoked image

Discussion in 'iOS Development' started by johnmabassa, Mar 19, 2009.

  1. johnmabassa

    johnmabassa Member

    Joined:
    Mar 16, 2009
    Messages:
    87
    Likes Received:
    0
    I was trying to make an app where you have an image which is covered by a grey image ( smoke

    Please Register or Log in to view images

    ) and once you move your finger on it......the original image in that location should come visible........ what should be the right approach to do it??....

    -John
  2. Cyanidepoison

    Cyanidepoison Active Member

    Joined:
    Jan 18, 2008
    Messages:
    1,076
    Likes Received:
    2
    Detect touch of the UIView that the image is in, then do a transition that makes the image appear to "fade out".
  3. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Subclass UIImageView into smoked image. Override the setImage method and make the code something like this: - (void) setImage

    Please Register or Log in to view images

    UIImage *)anImage { [super setImage:anImage]; [self addSubview:smokeView] };

    Override the UIImageView's touch methods sort of like this: ...touchesBegan:... { [super ...touchesBegan...]; smoke.alpha = 0.0; } and this: ...touchesEnded:... { [super ...touchesEnded:...]; [UIView beginAnimations:nil context:NULL]; smoke.alpha = 1.0; [UIView commitAnimations]; }
  4. johnmabassa

    johnmabassa Member

    Joined:
    Mar 16, 2009
    Messages:
    87
    Likes Received:
    0
    I think there was a confusion actually I wanted the original image in the touched position to appear
    Let me give an example...

    Suppose u are standing infront of a fogged mirror.....when u drag your finger on it....your face comes visible on that touched area.... I was trying to do that....I hope now it is clear....

    in between can u just look at my code in my other thread "Need help with UITouch" whether I am doing the right thing or not??
    -Thanks
    -John
  5. DJT

    DJT New Member

    Joined:
    Mar 17, 2008
    Messages:
    65
    Likes Received:
    1
    Device:
    3G iPod touch
    I think he means something like iSteam. Sorry if I'm wrong.

Share This Page