This is a migrated thread and some comments may be shown as answers.

PngBitmapEncoder and Opacity problem

6 Answers 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
JC
Top achievements
Rank 1
JC asked on 02 Nov 2010, 05:28 PM
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

6 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 05 Nov 2010, 08:50 AM
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
0
JC
Top achievements
Rank 1
answered on 05 Nov 2010, 09:59 AM
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 
0
Giuseppe
Telerik team
answered on 09 Nov 2010, 03:05 PM
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
0
Abdul
Top achievements
Rank 1
answered on 26 Oct 2011, 08:16 AM
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.
0
Andrey
Telerik team
answered on 28 Oct 2011, 05:01 PM
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 >>

0
FENWICK
Top achievements
Rank 1
answered on 02 May 2012, 02:57 PM
Hello,

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


thanks to your reply.
Tags
General Discussions
Asked by
JC
Top achievements
Rank 1
Answers by
Andrey
Telerik team
JC
Top achievements
Rank 1
Giuseppe
Telerik team
Abdul
Top achievements
Rank 1
FENWICK
Top achievements
Rank 1
Share this question
or