Click here to Skip to main content
15,880,796 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Dave Kreskowiak4-Nov-17 4:19
mveDave Kreskowiak4-Nov-17 4:19 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin14-Nov-17 5:57
alin14-Nov-17 5:57 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre4-Nov-17 6:27
professionalSascha Lefèvre4-Nov-17 6:27 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin14-Nov-17 7:05
alin14-Nov-17 7:05 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre4-Nov-17 7:13
professionalSascha Lefèvre4-Nov-17 7:13 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin14-Nov-17 7:22
alin14-Nov-17 7:22 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre4-Nov-17 7:25
professionalSascha Lefèvre4-Nov-17 7:25 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin14-Nov-17 7:30
alin14-Nov-17 7:30 
Yes. I added also a caption for each item. I wanted to fix that later. Anyway, I modified the code a little and it works, but unfortunately the ListView flickers a lot (it's not useable like that):
void BackgroundWorker1DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
{
    for (var i = 0; i < fileList.Count; i++)
    {
        Bitmap thumbnail = MakeThumbnail(fileList[i], 200, 200);
        backgroundWorker1.ReportProgress(i, thumbnail);
    }
}

void BackgroundWorker1ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
{
    imageList1.Images.Add((Bitmap)e.UserState);
    ListViewItem caption = new ListViewItem(Path.GetFileName(fileList[e.ProgressPercentage]));
    caption.ImageIndex = e.ProgressPercentage;
    listView1.Items.Add(caption);
}

void LoadListView()
{
    listView1.LargeImageList = imageList1;
    backgroundWorker1.RunWorkerAsync();
}


Any idea how to improve it?

modified 4-Nov-17 13:48pm.

GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre4-Nov-17 7:39
professionalSascha Lefèvre4-Nov-17 7:39 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin14-Nov-17 7:41
alin14-Nov-17 7:41 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre4-Nov-17 7:55
professionalSascha Lefèvre4-Nov-17 7:55 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin14-Nov-17 8:23
alin14-Nov-17 8:23 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre4-Nov-17 8:29
professionalSascha Lefèvre4-Nov-17 8:29 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin15-Nov-17 2:41
alin15-Nov-17 2:41 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre5-Nov-17 2:53
professionalSascha Lefèvre5-Nov-17 2:53 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin15-Nov-17 3:09
alin15-Nov-17 3:09 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre5-Nov-17 3:43
professionalSascha Lefèvre5-Nov-17 3:43 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin15-Nov-17 4:58
alin15-Nov-17 4:58 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin15-Nov-17 13:22
alin15-Nov-17 13:22 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre5-Nov-17 20:52
professionalSascha Lefèvre5-Nov-17 20:52 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
alin16-Nov-17 2:56
alin16-Nov-17 2:56 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Sascha Lefèvre6-Nov-17 3:00
professionalSascha Lefèvre6-Nov-17 3:00 
GeneralRe: How to make the ListView to display each thumbnail immediately after it's loaded? Pin
Gerry Schmitz4-Nov-17 7:39
mveGerry Schmitz4-Nov-17 7:39 
QuestionRun List Of Tasks Sequentially and Process Them As The Complete Pin
Kevin Marois1-Nov-17 8:47
professionalKevin Marois1-Nov-17 8:47 
AnswerRe: Run List Of Tasks Sequentially and Process Them As The Complete Pin
ZurdoDev1-Nov-17 9:37
professionalZurdoDev1-Nov-17 9:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.