Hi...could someone help me figure out how load my thumbnails either faster....or just in the background so I can still use my UI? I have a form that loads/imports photos and it takes about 5 to 6 seconds to load thumbnails of just average sized photos. I'm using a progress bar which is just sitting in the middle of my UI until the thumbnails load. Can someone help out? Here is my populateTree function: (I'm using a e.Graphics.DrawImage() in my Utilities.cs to draw the actual thumbnail)
Using VSPro2010Code:private void PopulateTree() { string[] albumList = Directory.GetFiles(_directoryCurrentUser, "*" + ".album"); treeView_Albums.Nodes.Clear(); //Clears nodes so they can be added again int totalAlbums = albumList.Count(); //Loop through each found file and add it to tree. Set its path and show the file name for (int i = 0; i < totalAlbums; i++) { var node = new TreeNode { Name = albumList[i], Text = Utilities.getNameFromPath(albumList[i]) + _albumData.AlbumGetPhotoCount(albumList[i]), ImageIndex = 0 }; treeView_Albums.Nodes.Add(node); if (node.Name == _albumData.FilePath) //Highlight if album node is open { node.BackColor = Color.LightGray; } } }
Thanks in advance....



LinkBack URL
About LinkBacks


