[ACCEPTED]-Convert Transparent PNG to JPG with Non-Black Background Color-alpha-transparency
Accepted answer
// Assumes myImage is the PNG you are converting
using (var b = new Bitmap(myImage.Width, myImage.Height)) {
b.SetResolution(myImage.HorizontalResolution, myImage.VerticalResolution);
using (var g = Graphics.FromImage(b)) {
g.Clear(Color.White);
g.DrawImageUnscaled(myImage, 0, 0);
}
// Now save b as a JPEG like you normally would
}
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.