png to bmp

拟墨画扇 提交于 2019-11-26 22:00:13

问题


is there anyway that i can convert a png to a bmp in c#

i want to download a image then convert it to a bmp then set it as the desktop background

i have the downloading bit and the background bit done

i just need to convert the png to a bmp


回答1:


Image Dummy = Image.FromFile("image.png");
Dummy.Save("image.bmp", ImageFormat.Bmp);



回答2:


Certainly. You'd want to load up a Bitmap object with your png:

Bitmap myBitmap = new Bitmap("mypng.png");

Then save it:

myBitmap.Save("mybmp.bmp", System.Drawing.Imaging.ImageFormat.Bmp);



回答3:


Have you tried this?

Image imgFile = Image.FromFile(aFileName);
imgFile .Save(strOutFileName, ImageFormat.Bmp);


来源:https://stackoverflow.com/questions/1060442/png-to-bmp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!