locked
Is there a way to grayscale an image in Xamarin Forms? RRS feed

  • Question

  • User335367 posted

    You know how you can disable buttons and they have a disable color. Well lets say we have an image on a row that I also want to turn black and white depending on if that item is active or not. Is there anything available for this?

    Thursday, March 22, 2018 2:22 PM

Answers

  • User180523 posted

    https://www.nuget.org/packages/Plugin.CrossPlatformTintedImage/

    Though a less processor intensive approach might be to put a BoxView on top of the Image. Set the color of the boxview to a mostly transparent grey. If the item is enabled, hide the BoxView. If the item is Disabled show the BoxView.

    This does 2 things for you. (1) makes the item look disabled without having to reprocess the bitmap. (2) acts like a covering object to block user taps and thus actually disables user interaction with the image below.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, March 22, 2018 2:24 PM

All replies

  • User180523 posted

    https://www.nuget.org/packages/Plugin.CrossPlatformTintedImage/

    Though a less processor intensive approach might be to put a BoxView on top of the Image. Set the color of the boxview to a mostly transparent grey. If the item is enabled, hide the BoxView. If the item is Disabled show the BoxView.

    This does 2 things for you. (1) makes the item look disabled without having to reprocess the bitmap. (2) acts like a covering object to block user taps and thus actually disables user interaction with the image below.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, March 22, 2018 2:24 PM
  • User335367 posted

    Thank you!

    Thursday, March 22, 2018 2:25 PM