Doubt in Clear the color of the image

Discussion in 'iOS Programming' started by iphonejudy, Apr 22, 2009.

  1. macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #1
    I need to clear the color of the image,which is already colored.

    I used the below code:

    Code:
    UIColor *clearColor;
    	clearColor = [UIColor clearColor];
    	myColor=clearColor;
    [self colorizeImage:image1.image color:theColor1];
    
    
    - (UIImage *)colorizeImage:(UIImage *)baseImages color:(UIColor *)theColor {
    }
    But its not working.
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Depending on how your method is written you are simply "painting" the image with a totally transparent colour: so nothing changes.
     
  3. thread starter macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #3
    But the other colors(red,green,blue) are changed.

    Any solution?
     
  4. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    I don't understand what you are asking. Of course if you paint over the image with red then it changes. But if you paint over it with a totally transparent colour it doesn't change. This is simply common sense. Why don't you use white instead of clear? You probably actually want this anyway. Otherwise you need to look at the method and ensure however you are setting the pixel-colours sets the colour to what is provided and does not draw over with this colour.
     
  5. thread starter macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #5
    I also tried with white earlier before used clear.but no luck.
     
  6. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    Then you have made a mistake in your code somewhere. As I've said before if you can't make it work pay for a professional who knows what they are doing: all you seem to do is copy and paste without any understanding so I am not surprised in the slightest that it doesn't work.
     
  7. thread starter macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008

Share This Page