Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIImage RenderingMode : UIImageRenderingModeAutomatic vs UIImageRenderingModeAlwaysOriginal vs UIImageRenderingModeAlwaysTemplate [closed]

I have come across the UIImage property UIImageRenderingMode which is introduced in iOS 7. But I don't get the differences among different UIImageRenderingModes that are UIImageRenderingModeAutomatic, UIImageRenderingModeAlwaysOriginal and UIImageRenderingModeAlwaysTemplate.

I want to know the basic meaning of them and when/how to use them.

like image 539
Geek Avatar asked Jan 18 '14 05:01

Geek


1 Answers

I found a tutorial which explains UIImageRenderingMode with example.

From tutorial :

UIImageRenderingModeAlwaysTemplate mode will replace all non-transparent colors on a UIImage with the tint color. The entire background and any portion of the image that you do not wish to render using the tint color must be completely transparent.

UIImageRenderingModeAlwaysOriginal. When this is applied the tint color is never applied to the image so the original color is always used when rendering the image.

UIImageRenderingModeAutomatic automatically decides which rendering mode to use based on where the image is being displayed. This is the default value for images.

like image 52
Geek Avatar answered Oct 12 '22 22:10

Geek