+ (UIImage *)coloredImage:(UIImage *)image
:(UIColor *)color
{
UIGraphicsBeginImageContext(image.size);CGContextRef context = UIGraphicsGetCurrentContext();[color setFill];CGContextTranslateCTM(context, 0, image.size.height);
CGContextScaleCTM(context, 1.0, -1.0);CGContextSetBlendMode(context, kCGBlendModeColorBurn);
CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height);
CGContextDrawImage(context, rect, image.CGImage);CGContextClipToMask(context, rect, image.CGImage);
CGContextAddRect(context, rect);
CGContextDrawPath(context, kCGPathFill);UIImage *coloredImage = UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();return coloredImage;

解决方案 »

  1.   

    你是说直接转成java?那怎么可能……
      

  2.   

    转成android的代码,只要功能一样就可以,或者有没有解决方案
      

  3.   

    按照我的理解  
    这段代码就是把你的 image 的像素 和 color 的值混合一下
      

  4.   

    首先你要明白代码的意思,然后你需要找java中和例子中函数功能一致的东西。