可以将位图对象另存为PNG或JPEG文件格式 [英] Can bitmap object be save as PNG or JPEG file format
本文介绍了可以将位图对象另存为PNG或JPEG文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
C#位图是否支持将对象保存为JPEG或PNG文件格式?
Is C# bitmap supporting saving the object to JPEG or PNG file format?
推荐答案
Bitmap extends Image, therefore you can call: Image.Save (String, ImageFormat)
. For example:
using System.Drawing
// ...
Bitmap img = new Bitmap("file.jpg");
img.Save("file.png", ImageFormat.Png); // ImageFormat.Jpeg, etc
省略第二个参数,仅调用 Image.Save(String)
会将图像另存为
Omitting the second argument and just calling Image.Save(String)
will save the image as its raw format.
这篇关于可以将位图对象另存为PNG或JPEG文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文