The Revit API does not provide any built-in support for this, but you can make use of generic Windows API functionality instead. Revit project files use Windows structured storage to manage resources internally. You can use the DocFile Viewer utility dfview.exe to look at the structured storage file contents. Here is an example of a Revit project file with the preview image highlighted:
We had a short look at the internal RVT file structure when exploring how to extract the Revit build version from RVT and RFA files.
The thumbnail is a standard PNG file inserted into the Revit structured storage document.
To extract the preview thumbnail image, you can use the Windows IExtractImage interface. Preview.dll is a shell plug-in, i.e. an object that implements this interface. It is used by the Windows Shell Folders to extract preview images for "known" file types. The preview extractor needs to register itself in the registry and implement the two following standard API functions:
STDMETHOD(GetLocation)( LPWSTR pszPathBuffer, DWORD cchMax, DWORD *pdwPriority, const SIZE *prgSize, DWORD dwRecClrDepth, DWORD *pdwFlags); STDMETHOD(Extract)(HBITMAP*);
More details and sample code are available from Guy's post.