c# Bitmap.Save transparancy doesn't save in png

Posted by kelton52 on Stack Overflow See other posts from Stack Overflow or by kelton52
Published on 2010-02-05T08:00:35Z Indexed on 2010/05/28 19:22 UTC
Read the original article Hit count: 387

Filed under:
|
|
|
|

I'm trying to save a Bitmap class that has transparancy as a png file with transparancy. I'm having no luck.

The bitmap has transparancy, it just doesn't save with transparancy.

this is what I'm doing

bitmap setup

Bitmap ret = new Bitmap(bWidth, bHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

saveing

ret.Save(filename, ImageFormat.Png);

I also tried saving the file with a filestream, and that made no difference.

When the image is in a Picture box the transparancy exists, but when I save i I just get a black background.

I really don't want to use any 3rd party code, they found a way to do it, I'd like to also.

thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about image