保存在C#中的图像文件 [英] save image files in C#

查看:193
本文介绍了保存在C#中的图像文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何能保存图像文件(类型,如JPG或PNG)在C#?

How can we save image files (types such as jpg or png) in C#?

推荐答案

在C#中我们使用这些参数Image.Save方法(字符串文件名,的imageformat)

in c# us the Image.Save Method with these parameters (string Filename , ImageFormat)

<一个href="http://msdn.microsoft.com/en-us/library/9t4syfhh.aspx">http://msdn.microsoft.com/en-us/library/9t4syfhh.aspx

这就是你需要的?

// Construct a bitmap from the button image resource.
Bitmap bmp1 = new Bitmap(typeof(Button), "Button.bmp");

// Save the image as a GIF.
bmp1.Save("c:\\button.gif", System.Drawing.Imaging.ImageFormat.Gif);

这篇关于保存在C#中的图像文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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