Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iphonejudy

macrumors 6502
Original poster
Sep 12, 2008
301
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.
 
Depending on how your method is written you are simply "painting" the image with a totally transparent colour: so nothing changes.
 
But the other colors(red,green,blue) are changed.

Any solution?

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.
 
I also tried with white earlier before used clear.but no luck.

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.