Set background color of PNG?

Discussion in 'ASP .Net' started by Mark B, Dec 7, 2008.

  1. Mark B

    Mark B Guest

    I have a PNG (a globe created in Adobe Illustrator) with transparency
    outside the circle. It displays fine on IE 7 but on IE 6 the area outside
    the circle is a peach color.

    How can I set the transparent area outside the globe to be white (so that at
    least for <= IE 6 it is white outside the globe)?

    Dim strFrameFileName As String =
    HttpContext.Current.Server.MapPath("~/pages/images/image_globe.png")
    Dim imgFrame As Bitmap = DirectCast(Image.FromFile(strFrameFileName),
    Bitmap)
    Dim g As Graphics = Graphics.FromImage(imgFrame)
     
    Mark B, Dec 7, 2008
    #1
    1. Advertising

  2. Mark B

    bruce barker Guest

    you are going to hate this. IE 6.0 only supports 8 bit transparent
    png's. if your image is simple without at lot of shading it should look
    ok as 8 bit.

    if you need 24 bit, then there is an IE 6.0 hack using a downloaded
    filter, but it has some restrictions. here is a good article:

    http://24ways.org/2007/supersleight-transparent-png-in-ie6



    -- bruce (sqlwork.com)


    Mark B wrote:
    > I have a PNG (a globe created in Adobe Illustrator) with transparency
    > outside the circle. It displays fine on IE 7 but on IE 6 the area
    > outside the circle is a peach color.
    >
    > How can I set the transparent area outside the globe to be white (so
    > that at least for <= IE 6 it is white outside the globe)?
    >
    > Dim strFrameFileName As String =
    > HttpContext.Current.Server.MapPath("~/pages/images/image_globe.png")
    > Dim imgFrame As Bitmap = DirectCast(Image.FromFile(strFrameFileName),
    > Bitmap)
    > Dim g As Graphics = Graphics.FromImage(imgFrame)
    >
     
    bruce barker, Dec 7, 2008
    #2
    1. Advertising

  3. Mark B

    Hillbilly Guest

    The easiest? Just edit the file in a paint program and change the peachy
    color to white and maintain transparency for white noting any other white in
    the image will be also be transparent in browsers that support png
    transparency.

    "Mark B" <> wrote in message
    news:%...
    >I have a PNG (a globe created in Adobe Illustrator) with transparency
    >outside the circle. It displays fine on IE 7 but on IE 6 the area outside
    >the circle is a peach color.
    >
    > How can I set the transparent area outside the globe to be white (so that
    > at least for <= IE 6 it is white outside the globe)?
    >
    > Dim strFrameFileName As String =
    > HttpContext.Current.Server.MapPath("~/pages/images/image_globe.png")
    > Dim imgFrame As Bitmap = DirectCast(Image.FromFile(strFrameFileName),
    > Bitmap)
    > Dim g As Graphics = Graphics.FromImage(imgFrame)
    >
     
    Hillbilly, Dec 7, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wayne  Wengert

    Set TextBox Background Color

    Wayne Wengert, Feb 12, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    22,613
    Wayne Wengert
    Feb 12, 2005
  2. Replies:
    0
    Views:
    483
  3. fig000
    Replies:
    0
    Views:
    4,576
    fig000
    Sep 6, 2004
  4. Kamaljeet Saini
    Replies:
    0
    Views:
    467
    Kamaljeet Saini
    Feb 13, 2009
  5. Replies:
    1
    Views:
    296
    marss
    Feb 14, 2007
Loading...

Share This Page