PngBitmapEncoder and Opacity problem

7 posts, 0 answers
  1. JC
    JC avatar
    37 posts
    Member since:
    Sep 2010

    Posted 02 Nov 2010 Link to this post

    Hello Guys

    I have a problem when I encode a image in png.
    I use a OpenFileDialog and call this method after : 
    public static byte[] EncodeToPng(BitmapSource bitmap)
    {
      byte[] retval;
      using (MemoryStream stream = new MemoryStream())
      {
        var encoder = new PngBitmapEncoder();
        encoder.Frames.Add(BitmapFrame.Create(bitmap));
        encoder.Save(stream);
        retval = stream.ToBytes();
      }
      return retval;
    }

    I need a byte[] to send it to my server with RIA services ... but that's not the problem

    So when I bind my <Image> control to my byte array, I use an IValueConverter which call this method :
    public static BitmapImage ToBitmapImage(this byte[] buffer)
    {
      BitmapImage imageMateriel = new BitmapImage();
      imageMateriel.SetSource(new MemoryStream(buffer));
      return imageMateriel;
    }

    And it working :) BUT when I take a PNG file with opacity ... image rendenring is gray !
    You can get my test file here : http://www.alfileo.fr/images/logo.png
    And my result file in the attached file on this post

    Can you try it please ?
    Best regards

    JC
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 05 Nov 2010 Link to this post

    Hello JC,

    Thank you for information.
    We have reproduced the problem with transparent image for rendering using PNG-encoder. Unfortunately it will take significant time to research into the problem.

    We have created the PITS issue to fix this problem in future releases.
    You can track it using the following link:
    http://www.telerik.com/support/pits.aspx#/public/silverlight/3900

    Sincerely yours,
    Andrey Murzov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. JC
    JC avatar
    37 posts
    Member since:
    Sep 2010

    Posted 05 Nov 2010 Link to this post

    Glad to help to find bugs ;-)
    I do himself some research and I knew it was complicated ... Good luck to find

    PS : I've won any telerik point to this ?

    Thanks 
  4. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 09 Nov 2010 Link to this post

    Hello JC,

    We have updated your Telerik points for reporting this issue.


    Best wishes,
    Freddie
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Abdul
    Abdul avatar
    5 posts
    Member since:
    Jan 2011

    Posted 26 Oct 2011 Link to this post

    Are there any updates regarding the issue? I am running into the same bug and this is blocking me. I can't have images with gray color instead of transparent.
  6. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 28 Oct 2011 Link to this post

    Hello Abdul,

    Unfortunately the problem is not solved yet. We already have the PITS for this issue:
    http://www.telerik.com/support/pits.aspx#/public/silverlight/3900
     
    One of the major criteria for prioritizing feature development is the number of customers' votes in our PITS and you can cast your vote for this issue.

    Best wishes,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. FENWICK
    FENWICK avatar
    30 posts
    Member since:
    Jul 2010

    Posted 02 May 2012 Link to this post

    Hello,

    Do you have Solved the bug ?
    Are you working on this bug ?


    thanks to your reply.
Back to Top