UIImage RenderingMode : UIImageRenderingModeAutomatic vs UIImageRenderingModeAlwaysOriginal vs UIImageRenderingModeAlwaysTemplate [closed]
Asked Answered
M

1

11

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.

Mischa answered 18/1, 2014 at 5:49 Comment(4)
You can read about the properties here: developer.apple.com/library/ios/documentation/uikit/reference/…Valenevalenka
@NathanWride Read but could not understand as there is no example.Mischa
@Abizern, Filip, ling.s, Alberto, Laszlo I edited my question to fit in the SO format.Mischa
@NathanWride, "UIImageRenderingMode: Specifies the possible rendering modes for an image." Great help on that link. Not.Wilser
M
20

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.

Mischa answered 18/1, 2014 at 5:54 Comment(3)
Unfortunately, the tutorial link is now broken. Thanks that you copied the essential info here.Crossed
UIImageRenderingModeAutomatic is still not clear.Drop
@ooops heeey I've figured it out, take a look: https://mcmap.net/q/1015501/-uiimage-renderingmode-automatic-how-does-it-choose-the-actual-modeUpbraid

© 2022 - 2024 — McMap. All rights reserved.