2

I have Bitmap image with alpha channel transparency. I am converting this BMP image to PNG format. Here is my code:

string tmp = @"c:\mypath\imageName";
using (Bitmap changeFormat = new Bitmap(tmp+".bmp"))
{
    changeFormat.Save(tmp + ".png", ImageFormat.Png)
}

Everything is okay. I now have a PNG image but alpha channel is now white instead of transparent (which it was in the BMP image).

Ps:test window XP, that PNG imgae when open in window 7 it ok . And open with Gimp soft.

Abbas
  • 6,720
  • 4
  • 35
  • 49
dellos
  • 327
  • 5
  • 15
  • Take a look at this questions and it's answer: http://stackoverflow.com/questions/10658994/using-graphics-drawimage-to-draw-image-with-transparency-alpha-channel – Abbas Apr 18 '13 at 04:27
  • Thank but not my problem. I need change Image Type with all channel don't change. – dellos Apr 18 '13 at 05:33
  • I check bmp by PixelFormat property and result is "Format32bppRgb". ?? My bmp image is 32bit RBGA image. in bitmap header binary show: 42 47 52 73 – dellos Apr 18 '13 at 05:40
  • Can you add the image or one that reproduces the issue to your question? – Ryan Gates Jun 14 '13 at 14:48

0 Answers0