日期:2014-05-17 浏览次数:20815 次
public void Loadimage()
{
if (MessageBox.Show("载入盘符设定为" + comboBox1.Text, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
#region 回收内存和释放控件列队
images.Clear();
listView1.Items.Clear();
imageList1.Images.Clear();
if (narTemp != null)
{
Pimages.Clear();
narTemp.Dispose();
GC.Collect();
}
#endregion
GetFile(@comboBox1.Text);
imageList1.ImageSize = new Size(100, 120);//设置缩略图大小
progressBar1.Value = 0;
progressBar1.Maximum = images.Count;
label1.Text = "已查找到" + images.Count.ToString() + "张图像";
label1.Refresh();
try
{
foreach (string image in images)
{
progressBar1.Value = progressBar1.Value + 1;
FileStream files = new FileStream(image, FileMode.Open,