Image另存为其他格式

 

 

string imgPath = @"C:\ZHM01000001400001-01 青龙 白虎.tif";
Image img = Image.FromFile(imgPath);
Bitmap tmpbitmap = new Bitmap(img);
img = tmpbitmap;

string savePath = Path.Combine(Path.GetDirectoryName(imgPath), Path.GetFileNameWithoutExtension(imgPath) + "sl.jpg");
//可以选择格式
img.Save(savePath, System.Drawing.Imaging.ImageFormat.Jpeg);

 

posted @ 2019-08-01 14:42  sunshuaize  阅读(236)  评论(0编辑  收藏  举报