iOS Colorizing Grey PNG-Alpha

Chris74

macrumors newbie
I need to colorize the image data of a grey PNG-Alpha without losing its transparency. How can I do this?

I believe I tried everything mentioned in the "Quartz 2D Programming Guide" and QuickDrawToQuartz2D and so much more. Without success.

The mentioned approach to colorize an image:

CGContextDrawImage(context, myRect1, image);
CGContextSetBlendMode(context, kCGBlendModeColor);
CGContextSetRGBFillColor (context, 0.8, 0.0, 0.0, 1.0);
CGContextFillRect (context, myRect2);

Colorizes the whole rectangle (my image but also its transparent background).

I'm new to Cocoa, IPhone and co. and I'd be so happy if anyone of can help or has some good pointers. I searched on the internet half of the day today to get this done.

- Chris
 
CGContextSetBlendMode with alpha transparency

Hi Chris,

I'm stuck with the very same problem. Have you found a solution to this or another way to colorize a PNG (with relative color to each grey value).

Please let me know how things worked out. I'd love to know how you solved this issue.

--

Jordan

I need to colorize the image data of a grey PNG-Alpha without losing its transparency. How can I do this?

I believe I tried everything mentioned in the "Quartz 2D Programming Guide" and QuickDrawToQuartz2D and so much more. Without success.

The mentioned approach to colorize an image:

CGContextDrawImage(context, myRect1, image);
CGContextSetBlendMode(context, kCGBlendModeColor);
CGContextSetRGBFillColor (context, 0.8, 0.0, 0.0, 1.0);
CGContextFillRect (context, myRect2);

Colorizes the whole rectangle (my image but also its transparent background).

I'm new to Cocoa, IPhone and co. and I'd be so happy if anyone of can help or has some good pointers. I searched on the internet half of the day today to get this done.

- Chris
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.
Back
Top