我想保存有transparancy与transparancy一个PNG文件中的Bitmap类。我有没有运气。
I'm trying to save a Bitmap class that has transparancy as a png file with transparancy. I'm having no luck.
这是我在做什么。
Bitmap ret = new Bitmap(bWidth, bHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb);saveing
ret.Save(filename, ImageFormat.Png);我也试过节省了FILESTREAM文件,并没有什么区别。
I also tried saving the file with a filestream, and that made no difference.
在图像是一个图片框transparancy存在,但是当我救我我只是得到一个黑色的背景。
When the image is in a Picture box the transparancy exists, but when I save i I just get a black background.
我真的不希望使用任何第三方code,他们发现了一个办法做到这一点,我想也。
I really don't want to use any 3rd party code, they found a way to do it, I'd like to also.
感谢。
推荐答案我认为一个对话框的FilterIndex 0开始......但它实际上从1开始,所以我的图像用阿尔法transparancy被保存为照片与图像和GIF不支持Alpha透明度。所以,我的问题实际上是与该对话框。
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.
更多推荐
C#Bitmap.Save transparancy不PNG保存
发布评论