如何在可滚动面板中查看图像 [英] how can i view images in a scrollable panel

查看:91
本文介绍了如何在可滚动面板中查看图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以在列表视图或图像列表中查看图像吗?我正在使用c#winapp.当用户在文本框中输入查询时,系统运行,然后文本框中的文本将搜索xml文件.当文本匹配时,一个或多个图像将出现在图像列表或图片框中(如果文本包含多个图像或只有一个图像),则最适合的图像.

请帮助我完成这个项目..谢谢:)

is there any way to view images in listview or imagelist? i''m using c# winapp. the system goes when the user inputs a query in the textbox, then the text in the textbox will search the xml file. when the text match, the image or images will appear in imagelist or picturebox (if the text has many images or just one), whatever will fits most.

please help me with this project.. thanks :)

推荐答案

尝试一下,希望对您有所帮助:
Try this, hope it will help you:
private void Form1_Load(object sender, EventArgs e)
       {
           this.listView1.LargeImageList = this.imageList1;
           DirectoryInfo di = new DirectoryInfo(@"F:\TEMP\");
           this.listView1.View = View.LargeIcon;
           foreach (FileInfo fi in di.GetFiles("*.jpg"))
           {
               this.listView1.Items.Add(new ListViewItem(fi.Name, fi.FullName));
               this.imageList1.Images.Add(fi.FullName, Image.FromFile(fi.FullName));
           }
       }


这篇关于如何在可滚动面板中查看图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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