Пример #1
0
 /// <summary>
 /// Notify from thumbnailthread. Next Thumbnail is ready
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void thumbnailtread_NewFrame(object sender, ThumbnailEventArgs e)
 {
     if (tvaFiles.InvokeRequired)
     {
         tvaFiles.Invoke(new MethodInvoker(
         delegate()
         {
             SetThumbnail(e);
         }));
     }
     else
     {
         SetThumbnail(e);
     }
 }
Пример #2
0
        /// <summary>
        /// Set the Thumbnail in Treeview
        /// </summary>
        /// <param name="tnea"></param>
        private void SetThumbnail(ThumbnailEventArgs tnea)
        {
            if (tnea.Count >= tnea.TotalCount)
            {
                tspbThumbnailsLoad.Value = 0;
                tsslMessage.Text = "Thumbnail download done.";
            }
            //Get Node from dir and filename
            Node n = GetNode(tnea.Filename);
            if(n != null)
            {
                tspbThumbnailsLoad.Minimum = 0;
                tspbThumbnailsLoad.Maximum = tnea.TotalCount;
                tspbThumbnailsLoad.Value = tnea.Count;
                tsslMessage.Text = string.Format("... loading thumbnail {0} of {1}", tnea.Count, tnea.TotalCount);

                n.Image = ks2.ResizeImage(tnea.Bitmap, 64, 48);

            }
        }