Thanks Jared, I've tried that with no great impact on performance. :(
Cheers,
Johan Sj?str?m
MSc, MCAD, MCTS, MCITP
Jared (Home) skrev:
Actually, I tried disconnecting the ListView from the ImageList by
setting the ListView's LargeImageList property to null, but to improve
performance I had to remove the connection from the designer as well.
Now the adding of images is very fast, but as soon as I connect the
ListView the computer really goes to work..
This example proves my point. It's a simple form with a Button,
ImageList and ListView. It's Part 2 that locks up the CPU for a good
minute or so.
private void button1_Click(object sender, EventArgs e)
{
// Part 1, add images to imagelist
imageList1.Images.Clear();
label1.Text = "Adding..";
label1.Update();
for (int i = 0; i < 5000; i++)
{
imageList1.Images.Add(new Bitmap(1, 1));
}
// Part 2, connect listview to imagelist
label1.Text = "Connecting listview..";
label1.Update();
listView1.LargeImageList = imageList1;
label1.Text = "Finished.";
label1.Update();
}
Cheers,
Johan Sjöström
MSc, MCAD, MCTS, MCITP
Johan Sjöström - 16 Jan 2007 10:30 GMT
Looks like I'm forced to go with the really fast DataGridView instead.
Adding bitmaps to an ImageColumn and binding it that way only takes a
second or so.
Guess ListView + ImageList isn't meant for heavy duty use..
Cheers
Johan Sjöström
MSc, MCAD, MCTS, MCITP