ios: change the colors of a UIImage

前端 未结 8 793
旧时难觅i
旧时难觅i 2020-11-27 12:50

I am working on an Iphone application.

I have png pictures that represents symbols. symbols are all black with a transparent background.

Is there a way I can

相关标签:
8条回答
  • 2020-11-27 13:22

    Set the Image rendering mode then for color purpose use tintcolor property.

    yourImageView.image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
    [yourImageView setTintColor:[UIColor redColor]];
    
    0 讨论(0)
  • 2020-11-27 13:25

    For playing with images using objective-c, mainly you have to use Quartz 2D/CoreGraphics framework. I suppose it will be the easiest way for you to accomplish your task.

    The link to Quartz 2D guideline is here , the guideline is pretty comprehensive. Just have a look somewhere in filling the bitmap with color.

    Also I've some records about the heavy image processing in my blog, you can have a look, it might be helpfull. http://levonp.blogspot.de/2012/05/quartz-getting-diff-images-of-two.html

    Of course you can do it also using more advanced stuffs like OpenGL, OpenCV, etc.

    0 讨论(0)
提交回复
热议问题