Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to set Image tint in Windows RT

$
0
0

I have created custom renderers for the Xamarin.Forms Image control for both Android and iOS that allow me to specify an image tint at runtime that is applied to the Image.

In Android I adjust the tint using a color filter on the ImageView:

var cf = new PorterDuffColorFilter(Element.TintColor.ToAndroid(), PorterDuff.Mode.SrcIn);
Control.SetColorFilter(cf);

In iOS I adjust the tint using the UIImageView's TintColor:

Control.Image = Control.Image.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
Control.TintColor = Element.TintColor.ToUIColor();

Does anyone know of a way to apply a tint effect on the Windows RT Image control? I've read a bit about loading the image as a bitmap and editing pixels manually, but that sounds horrible.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>