I'm trying to save a Bitmap class that has transparancy as a png file with transparancy. I'm having no luck.
this is what I'm doing
Bitmap ret = new Bitmap(bWidth, bHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
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.
I assumed that the FilterIndex of a dialog box started at 0...but it actually starts at 1, so my images were being saved as Gifs using alpha transparancy, and gif doesn't support alpha transparency. So my problem was actually with the dialog box.