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
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