示例#1
0
 private void MakeThumbnail(string path)
 {
     try
     {
         var thumbnail = Template.FindName("Thumbnail", this) as Rectangle;
         var bmp       = new Bitmap(Path);
         thumbnail.Fill = new ImageBrush(MagicLaboratory.ImageSourceForBitmap(bmp));
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
示例#2
0
 private void MakeThumbnail()
 {
     try
     {
         var thumbnail = Template.FindName("Thumbnail", this) as Rectangle;
         var icon      = System.Drawing.Icon.ExtractAssociatedIcon(Path);
         var bmp       = icon.ToBitmap();
         thumbnail.Fill = new ImageBrush(MagicLaboratory.ImageSourceForBitmap(bmp));
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }