更改面部颜色从xcode中的主要颜色 [英] Change Face Color From main color in xcode

查看:117
本文介绍了更改面部颜色从xcode中的主要颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ios中处理应用程序,我需要只更改图像面部颜色的工具或代码。

I work on application in ios and i need tool or code which change only face color of image .

我已经在uiimage中获得了面孔。

I already get face in uiimage.

现在如何将RGB颜色变换应用于那张脸的Uiimage?

Now How apply RGB color Change to Uiimage of that face?

提前致谢

推荐答案

你可以这样做,

  UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(50, 50, 50, 50)];

imageView.image = [UIImage imageNamed:@"Synch"];  // your face image here
imageView.image = [imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];

// imageView.backgroundColor = [UIColor yellowColor];
imageView.tintColor = [UIColor redColor]; // set different tint color here and image will get that color

[self.view addSubview:imageView];

图片应为 png 文件。同步图像在示例中为png格式。

Image should be png file. Synch image is in png format in example.

希望这会有所帮助:)

这篇关于更改面部颜色从xcode中的主要颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆