I'm using System.Drawing.Image in .Net to do a simple conversion from png to jpeg.
I'm basically just using these two lines of code:
Image img = Image.FromFile(filename);
img.Save(newFilename, System.Drawing.Imaging.ImageFormat.Jpeg);
it works fine except for when the png files contain transparency due to the alpha channel. In which case the converted jpeg has a black background. Is there any way to make the background white instead?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…