Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

PNG files appearing as white boxes instead of transparent RSS

5 replies

Last post Nov 26, 2007 05:14 AM by Yi-Lun Luo - MSFT

(0)
  • Jhorra

    Jhorra

    Member

    522 Points

    475 Posts

    PNG files appearing as white boxes instead of transparent

    Nov 22, 2007 05:02 AM | LINK

    We have a meter bridge that moves to a song, except the animation uses png files, with meters on them, and the majority of the image being clear.  In Silverlight they appear as just a big white image instead of showing transparent.  Is there a trick or a setting for this?  All other png files in the application show correclty. 

  • Cass

    Cass

    Contributor

    3157 Points

    654 Posts

    Re: PNG files appearing as white boxes instead of transparent

    Nov 22, 2007 05:32 AM | LINK

    This is a known issue and it has already been reported as bug. Hopefully it will be sorted in Beta version.

  • Jhorra

    Jhorra

    Member

    522 Points

    475 Posts

    Re: Re: PNG files appearing as white boxes instead of transparent

    Nov 22, 2007 05:44 AM | LINK

    Is it known if it is a specific setting in the png, or a setting in silverlight?  I have 7 other images that have no issues at all.  Also, this are part of an animation that changes their opacity, could that have anything to do with it? 

  • Cass

    Cass

    Contributor

    3157 Points

    654 Posts

    Re: PNG files appearing as white boxes instead of transparent

    Nov 22, 2007 06:11 AM | LINK

    The PNG where you see the white background instead of transparent is Indexed transparent PNG. And there is an issue with Indexed transparent PNG.

    It was reported to microsoft here http://silverlight.net/forums/p/6021/18496.aspx

  • Jhorra

    Jhorra

    Member

    522 Points

    475 Posts

    Re: Re: PNG files appearing as white boxes instead of transparent

    Nov 22, 2007 06:12 PM | LINK

    That link says that the bug is when they are not RGB files.  I double checked these, and they are.  Just to be sure I resaved them, and it didn't change.

  • Yi-Lun Luo - MSFT

    Yi-Lun Luo -...

    All-Star

    25149 Points

    2759 Posts

    Microsoft

    Re: PNG files appearing as white boxes instead of transparent

    Nov 26, 2007 05:14 AM | LINK

    Hello, as Cass said, currently Silverlight doesn’t support index transparent color. It only supports alpha transparency. Also, RGB doesn’t support transparent. You need RGBA. If you’re using Expression Design, please do the following:

    l  Create a background Rectangle which fills the whole art board.

    l  Make sure the Rectangle’s ZIndex is the smallest (right click, choose “Arrange” => “Send to Back”).

    l  Set the Rectangle’s Background’s Opacity to 0. That is, alpha should be 0.

    l  Export to a PNG file. In the “Export PNG” dialog, under “File format” => “Mode”, select “32 bits per pixel - RGBA”.

     

    Now you should be able to see transparency instead of white background. If you’re using other graphic editors, you should be able to find a similar way.

     

    shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.