png to bmp in C#

后端 未结 3 1148
旧时难觅i
旧时难觅i 2020-12-07 00:18

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 th

相关标签:
3条回答
  • 2020-12-07 00:57

    Have you tried this?

    Image imgFile = Image.FromFile(aFileName);
    imgFile .Save(strOutFileName, ImageFormat.Bmp);
    
    0 讨论(0)
  • 2020-12-07 01:01
    Image Dummy = Image.FromFile("image.png");
    Dummy.Save("image.bmp", ImageFormat.Bmp);
    
    0 讨论(0)
  • 2020-12-07 01:20

    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);
    
    0 讨论(0)
提交回复
热议问题