PDA

View Full Version : Doubt in Clear the color of the image




iphonejudy
Apr 22, 2009, 07:21 AM
I need to clear the color of the image,which is already colored.

I used the below 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.



robbieduncan
Apr 22, 2009, 07:29 AM
Depending on how your method is written you are simply "painting" the image with a totally transparent colour: so nothing changes.

iphonejudy
Apr 22, 2009, 07:32 AM
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?

robbieduncan
Apr 22, 2009, 07:34 AM
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.

iphonejudy
Apr 22, 2009, 07:42 AM
I also tried with white earlier before used clear.but no luck.

robbieduncan
Apr 22, 2009, 07:46 AM
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.

iphonejudy
Apr 22, 2009, 09:13 AM
I solved it ,by draw a clear image.