locked
WinRT BitmapIcon Alpha Bug

    Question

  • Can anyone explain what is going on with the BitmapIcon in WinRT?  As I understand it, and the documentation is sparse, the BitmapIcon basically strips the color information out of an image and allows you to replace it with a Foreground color.  However, if you create an image with white pixels and load it up in an BitmapIcon and set the foreground color to a "White" brush, it appears to corrupt the alpha values.  My images use pure white pixels with the alpha used to provide rounding touches against a dark background.  Here's what it looks like when loaded using an Image control:

    Here's what the same PNG file looks like when loaded up using a BitmapIcon and setting the Foreground to "White":

    The alpha information is completely lost.  All the pixels are set to 0xFFFFFF regardless of the alpha value in the original image.  Now here's where it gets a little strange.  If I use a "Black" Foreground color, I get:

    (See message below for additional image):

    • Edited by DRAirey1 Wednesday, May 7, 2014 5:26 PM
    Wednesday, May 7, 2014 5:19 PM

All replies

  • (Continued from previous message to include a third image):

    For some reason, the alpha shows up in some form on the darker images.  Instead of taking the alpha literally from the original PNG image, there seems to be some function related to the foreground brush being applied.  Can anyone give some insight into how the alpha component works (or doesn't work) on the BitmapIcon element?

    Wednesday, May 7, 2014 5:25 PM
  • Hi,

    Could you please share me one simple project with the image file so that I can quicker reproduce your issue on my side? You can upload it to onedrive then post back the link.

    Thanks.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, May 9, 2014 8:10 AM
    Moderator
  • Vicky, let me know if you have any trouble downloading or building this simple demo:

    https://skydrive.live.com/redir?resid=5A74095C3F9BEE47!1513

    Don

    Friday, May 9, 2014 11:17 AM
  • Hi Don,

    I can reproduce your issue, and I already report it to our senior engineers.

    Thanks.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, May 13, 2014 12:42 AM
    Moderator
  • Vicky,

    Thanks.  I already tried creating a precalculated alpha using Gimp and got pretty much the same results.  If they're using a standard format for the transparencies, it's not supported by GIMP or Paint.NET, which means it's useless.

    Don


    Donald Roy Airey

    Tuesday, May 13, 2014 1:23 AM
  • Hi Vicky, was there any response about this?  Is there any kind of work-around?
    Monday, January 19, 2015 7:47 PM