This project is read-only.

WritableBitmap with wrong colors

Jul 2, 2014 at 2:53 PM
Edited Jul 2, 2014 at 2:53 PM

I am using BitmapFactory to load a PNG from a file:
WriteableBitmap image = await BitmapFactory.New(1, 1).FromContent(new Uri("ms-appx:///Assets/image.png"));
When I display this image the colors are not correct. I have tried using different BitmapPixelFormat values but I always get the same result.

On the other hand, if I load the image into a BitmapImage object like this:
BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/image.png"));
the image is displayed correctly. Am I doing something wrong with WriteableBitmap?

Jul 25, 2014 at 2:58 PM
I still haven't found a fix for that. Does anybody have any clue why this is happening? Do I need to post more information? I would appreciate any help...

Oct 6, 2015 at 7:42 PM

I have the same problem. Seems to be related to 8bit png's. Because 32 bit works fine.
Have you found any solution to this problem?