It is possible to change the background color of an image where this image is all white in Xamarin.Ios

Asked

Viewed 32 times

0

I have an image that is white by default, it is possible to change this color via code?

  Cor ImagemFundobackground = CriarCor(RecursosCores.preto);  
  ImagemFundo.BackgroundColor =
  UIColor.FromRGB(ImagemFundobackground.Red,
  ImagemFundobackground.Green,  ImagemFundobackground.Blue);

Whereas Criacor is a function that brings color from the resources Imageworld is an element that is a Uiimageview

1 answer

0


For the problem at issue as the image was just white what I did was take the image and assign a color:

  Cor ImagemFundobackground = CriarCor(RecursosCores.preto);  
  ImagemFundo.Image = null;
  ImagemFundo.BackgroundColor =
  UIColor.FromRGB(ImagemFundobackground.Red,
  ImagemFundobackground.Green,  ImagemFundobackground.Blue);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.