如何对图像进行通用收集 [英] how can make generic collection for images
本文介绍了如何对图像进行通用收集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我要列出图像的一般列表.
我的文件夹中有一些图像,想要列出其通用列表.
因为我必须为其创建数据源并将其绑定到我的数据列表.
任何机构都可以帮助我.
hello,
I want to make a generic list of images.
I have some images in my folder and want to make its generic list.
because i have to make a datasource of it and bind it to my datalist.
can any body help me.
推荐答案
在实例化中使用可用的通用List类有什么问题,例如
System.Collections.Generic< System.Drawing.Bitmap>
?
要使用文件夹,请使用我以前的解决方案(另请参见讨论):
Directory.Get.Files搜索模式问题 [ ^ ].
—SA
What''s wrong about using available generic List class in instantiation like
System.Collections.Generic< System.Drawing.Bitmap>
?
For working with a folder, use my past Solution (also see the discussion):
Directory.Get.Files search pattern problem[^].
—SA
",您能告诉我它的代码吗?
如何使用
通过文件夹在其中添加图像 List image =列表();
image.add();"
"could you tell me the code for it.
how to add images in it through a folder using
List image=List();
image.add();"
string path = @"F:\Temp";
List<image> images = new List<image>();
string[] files = Directory.GetFiles(path, "*.jpg");
foreach (string file in files)
{
images.Add(Image.FromFile(file));
}
</image></image>
这篇关于如何对图像进行通用收集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文