Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Previews of matlab figures in Windows explorer (utility to set an image as the thumbnail for another file)

Has anyone come up with a way to make thumbnail type previews for matlab figures in windows?

I'm getting tired of saving a .png along with the .fig file just so I know what was in it.

A useful helper for this would be a command line utility for windows that can be provided with an image file and told to use that as the basis for the preview for a given file.

I could write a helper function in matlab that saved the .fig, made a temporary image file, then pushed that into the thumbnail using the command line utility.

like image 511
Alex Avatar asked Feb 17 '12 00:02

Alex


1 Answers

You can write a function in C++ that tells Windows how to generate thumbnails from your file. This link explains about it. Check out the section about Thumbnail Image handler. This is the function that you will need to implement.

From what I managed to understand, the procedure is this:

  1. Write a in-process COM server (DLL) that implements IThumbnailProvider interface
  2. Put the DLL file somewhere on your computer.
  3. Write an entry to the registry, by using the procedure described in this page.

That still leaves you with the problem of thumbnail extraction from .fig file. As far as I know, fig files are nothing but mat files. I am fairly sure that it is possible.

You will need a custom save function for all figures. It will print a thumbnail of the image (by using the print command), and save it inside the figure.

I know that it isn't much information, but it can help you to get started. You might as well ask someone who is highly proficient in COM technology for more help. Thus, I recommend adding a COM tag to the question.

Edit(1) - I've found a good tutorial on the subject:

like image 103
Andrey Rubshtein Avatar answered Nov 20 '22 16:11

Andrey Rubshtein