1

I am trying to get and show an icon on Windows Forms from a Blender file's preview icon.

I can only get Blender's default icon with Icon.ExtractAssociatedIcon but not the preview image that Blender makes when a Blender file is saved.

string imagePath = @"C:\tmp\Cube.blend";

Icon icon = Icon.ExtractAssociatedIcon(imagePath);

if(icon != null)
{
    var bitmapIcon = icon.ToBitmap();
    pictureBox1.Image = bitmapIcon;
}

I would like to get the preview icon to show in Windows Forms pictureBox if that is even possible.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
  • https://blender.stackexchange.com/questions/96580/in-the-folder-how-do-i-make-blender-files-show-a-preview-of-themodel?rq=1 – Ruchi Aug 06 '19 at 13:29
  • That is not what I am looking for. Windows already shows the preview icons of every blend file. I would like to know how to get the preview icon and use it in my Windows Forms application. – mikapetterij Aug 06 '19 at 13:41
  • I got it to work with the following example: https://stackoverflow.com/questions/1439719/c-sharp-get-thumbnail-from-file-via-windows-api – mikapetterij Aug 06 '19 at 13:45
  • *nix versions of blender include [blender-thumbnailer.py](https://developer.blender.org/diffusion/B/browse/master/release/bin/blender-thumbnailer.py$87), where you will find how to read the preview image from the blend file using python. – sambler Aug 07 '19 at 05:43

0 Answers0