C# get thumbnail from file via windows api

Ran across this today — it’s a few months old, but it got the job done for me (on Win7, extracting thumbnails on MPEG-4 files):

  • Source : https://github.com/dbarros/WindowsAPICodePack
  • Nuget : https://www.nuget.org/packages/WindowsAPICodePack-Shell

Code:

ShellFile shellFile = ShellFile.FromFilePath(pathToYourFile);
Bitmap shellThumb = shellFile.Thumbnail.ExtraLargeBitmap;

Hope it helps!

Leave a Comment