Problem with the method "FromContent" in WriteableBitmapExWinRT.dll

Sep 19, 2012 at 2:57 PM
Edited Sep 19, 2012 at 2:59 PM

I have a problem with the method FromContent. When I try to show a .png cut image using that method, colors are not mixed properly.
Here is a code example with the showed images using Windows 8 and Windows Phone dlls.

- Generated image  using WriteableBitmapExWinRT.dll  (Windows 8)

        http://imageshack.us/a/img43/3883/54464673.png


- Generated image using WriteableBitmapExWinPhone.dll (Windows Phone 7)

       http://imageshack.us/a/img27/3602/82042577.png

The game finds published here with Windows Phone 7

http://www.windowsphone.com/es-es/store/app/jump-the-frog/9e9a5c1a-bbb4-42eb-8148-d5b914ae47e6

Thank you very much.

Example code

        async public static System.Threading.Tasks.Task LoadImg()
        {
        ...
        ListRanaImg = (await BitmapFactory.New(320, 480).FromContent(new Uri("ms-appx:///Images/Rana.png"))).Split(80, 80);
        ...
        }
 
        public static List<WriteableBitmap> Split(this WriteableBitmap bmp, int tilewidth, int tileheight)
        {
            int num = bmp.PixelWidth;
            int num2 = bmp.PixelHeight;
            Rect destRect = new Rect(0.0, 0.0, (double)tilewidth, (double)tileheight);
            List<WriteableBitmap> list = new List<WriteableBitmap>();
            for (int i = 0; i < num2; i += tileheight)
            {
                for (int j = 0; j < num; j += tilewidth)
                {
                    WriteableBitmap bitmap = new WriteableBitmap(tilewidth, tileheight);
                    bitmap.Blit(destRect, bmp, new Rect((double)j, (double)i, (double)tilewidth, (double)tileheight));
                    list.Add(bitmap);
                }
            }
            return list;
        }
 
    
 
        RanaActual.Source = LoadContent.ListRanaImg[20];