Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-04-2010, 06:21 AM   #31 (permalink)
Dvdkite
Registered Member
 
Join Date: Sep 2009
Posts: 96
Dvdkite is on a distinguished road
Default

Hi !

Thank you !
It could be useful in the future..

However browsing the forum here and by google...I've found this code for tint / colorize a gray scale image...it work fine!!

Code:
+ (UIImage *)colorizeImage:(UIImage *)baseImage color:(UIColor *)theColor {
    UIGraphicsBeginImageContext(baseImage.size);
    
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    CGRect area = CGRectMake(0, 0, baseImage.size.width, baseImage.size.height);
    
    CGContextScaleCTM(ctx, 1, -1);
    CGContextTranslateCTM(ctx, 0, -area.size.height);
    
    CGContextSaveGState(ctx);
    CGContextClipToMask(ctx, area, baseImage.CGImage);
    
    [theColor set];
    CGContextFillRect(ctx, area);
 
    CGContextRestoreGState(ctx);
    
    CGContextSetBlendMode(ctx, kCGBlendModeMultiply);
    
    CGContextDrawImage(ctx, area, baseImage.CGImage);
 
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
    
    UIGraphicsEndImageContext();
    
    return newImage;
}
source here:
Apple - Support - Discussions - [iPhone] Color White Image ...
Dvdkite is offline   Reply With Quote
 

» Advertisements
» Online Users: 572
16 members and 556 guests
beckz007, BrianSlick, djbrooks111, djohnson, Domele, dylanreich, Hassasin, HemiMG, ilmman, kasumar, larueta13, mariano_donati, Newbie123, shwetap, SLIC, Thompson22
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,446
Threads: 94,031
Posts: 402,604
Top Poster: BrianSlick (7,978)
Welcome to our newest member, larueta13
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:00 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.