这段代码如何转成android代码?
+ (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;
}
--------------------编程问答-------------------- --------------------编程问答-------------------- 你是说直接转成java?那怎么可能…… --------------------编程问答-------------------- 转成android的代码,只要功能一样就可以,或者有没有解决方案 --------------------编程问答-------------------- 按照我的理解
这段代码就是把你的 image 的像素 和 color 的值混合一下 --------------------编程问答-------------------- 类库都不一样,不能“直译”,只能“意译”啦! --------------------编程问答-------------------- android 是 Bitmap好像 --------------------编程问答-------------------- 这点P代码还需要转换~有罪!!!! --------------------编程问答-------------------- 首先你要明白代码的意思,然后你需要找java中和例子中函数功能一致的东西。
补充:移动开发 , iPhone