如何从VS2005中的图像列表导出图像?

cbu*_*000 11 .net imagelist

使用Visual Studio 2005,有没有办法将图像列表中的图像导出到PC上的单个文件?使用IDE,我选择图像列表并查看其属性.在"Images"属性中,我启动了Images Collection Editor对话框.我只能添加和删除图像,但我找不到导出列表中已有图像的方法.

为什么?制作原始列表的开发人员离开了我们公司,我需要ASP.NET应用程序的图像(将转换为.jpeg).

感谢您的帮助!

Jas*_*kan 23

您可以编写一些简单的代码来导出图像.你没有提到你正在使用哪种语言,所以这里是C#和VB的解决方案.

C#

for (int x = 0; x < imageList1.Images.Count; ++x)
{
    Image temp = imageList1.Images[x];
    temp.Save("image" + x + ".bmp");
}
Run Code Online (Sandbox Code Playgroud)

VB

For x As Integer = 0 To imageList1.Images.Count - 1
    Dim temp As Image = imageList1.Images(x)
    temp.Save("image" & x & ".bmp")
Next
Run Code Online (Sandbox Code Playgroud)