Convert a dynamic BitmapImage to a grayscale BitmapImage in a Windows Phone application

后端 未结 3 789
误落风尘
误落风尘 2021-01-24 01:14

I would like to Convert a BitmapImage to a Grayscale BitmapImage: Which I get from a method and therefore - the Width and Height are unknown to me. I have tried looking into opt

3条回答
  •  没有蜡笔的小新
    2021-01-24 01:42

    You can't write to a BitmapImage: you'll need to convert it to a WriteableBitmap. Once you have a WriteableBitmap it's easy to access the buffer and convert the pixels to GreyScale.

    WriteableBitmaps and BitmapImages both work very similarly since they are both BitmapSources. You can add them to the same List if you create your List as a List rather than List

    It is unlikely the app will do anything with the List's contents that require the contents to be BitmapImages rather than BitmapSources.

提交回复
热议问题