C# listView载入图片以大图标方式显示
演示了imageList 和 listView的大图标模式,关键代码见下面:
p rivate void button1_Click(object sender, EventArgs e)
{
imageList1.ColorDepth = ColorDepth.Depth24Bit;
imageList1.ImageSize = new Size(120, 120);
for (int i = 0; i < 12; i++)
{
imageList1.Images.Add(Image.FromFile(Application.StartupPath + "\\"+(i+1).ToString()+".jpg"));
listView1.LargeImageList = imageList1;
listView1.Items.Add("韩版服装"+(i+1).ToString());
listView1.Items[i].ImageIndex = i;
}
}