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); } }
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); } }