I have a WriteableBitmap which loads the bitmap image from file(mostly bmp). The bitmap files I am using have different pixel formats such as Indexed8, Bgra32, etc etc. The problem is that my code only works for bgra32 pixel format. So I need help in converting the bitmaps to Bgra32 pixel format in c# wpf.
Thanks
I have found the solution:
if (bmpSource.Format != PixelFormats.Bgra32)
bmpSource = new FormatConvertedBitmap(bmpSource, PixelFormats.Bgra32, null, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With