如何将图像文件从一种格式转换为另一种格式? [英] How to Convert Image File from One format to another?

查看:91
本文介绍了如何将图像文件从一种格式转换为另一种格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用VB.NET将图像文件从一种格式转换为另一种格式,例如.jpg,.gif或.jpg到.png?

How to convert Image File from one format to another like .jpg to .gif or .jpg to .png using VB.NET?

推荐答案

是:加载正常使用,并使用Bitmap.Save方法:
Yes: Load it as normal, and use the Bitmap.Save method:
Dim myImage As Bitmap = DirectCast(Image.FromFile("D:\Temp\MyPic.jpg"), Bitmap)
myImage.Save("D:\Temp\MyPicSaved.png", ImageFormat.Png)

>


尝试一下
MSDN-如何:将图像从一种格式转换为另一种格式 [ ^ ]
Try this
MSDN - How to: Convert Images from One Format to Another[^]


您可以使用System.drawing.image类的save()方法,如下所示:
You can use save()method of System.drawing.image class like this:
Dim SourceImg As Image
      SourceImg = Image.FromFile(SourceFilePath)
      SourceImg.Save(DesFilepath, Imaging.ImageFormat.Png)



以下文章符合您的要求,请参阅此以获取更多信息和完整代码:
how-to-将图像文件从一种格式转换为另一个使用vb-net/ [



following article match your requirement, see this for more information and full code:
how-to-convert-image-file-from-one-format-to-another-using-vb-net/[^]


这篇关于如何将图像文件从一种格式转换为另一种格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆