How to add thumbnail to a .fig file in Windows 10?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Chaitanya Jha
am 29 Mär. 2019
Kommentiert: Chaitanya Jha
am 3 Apr. 2019
Hi, I am developing a software for Electrophysiology. In this software I do several Voltage and Current recording from cells such as neurons. In each recording there are multiple Voltage and Current plot lines in a single axis. I want to save these recordings in a figure file which when opened provides a group of checkboxes to select any number of these plot lines to be shown on its axis. I want to save these figure files with the thumbnaill showing the axis plot in winodws 10 (just like it happens with a picture where you have a thumbail showing the picture). Any ideas on how to achieve this?
2 Kommentare
Jan
am 29 Mär. 2019
Please provide picture of what you want. Why do you need checkboxes, when you can select the axes directly?
The question is quite general yet. What have you tried so far? How exactly can we help you?
Akzeptierte Antwort
Jan
am 3 Apr. 2019
The approach to use the thumbnail of the image in the Windows Explorer is rather indirect. This is not the purpose of the Windows Explorer, although the thumbnail selection is implemented e.g. for JPG images.
What about using a tool, which does exactly, what you want? You can export a screenshot of the figure as PNG and display a list of them in another figure. The callback of each image opens the correponding FIG file.
Example:
for k = 1:4
Fig(k) = figure;
image(rand(10, 10));
print(Fig(k), fullfile(tempdir, sprintf('Fig%d.png', k)), '-dpng');
savefig(Fig(k), fullfile(tempdir, sprintf('Fig%d.fig', k)), '-compact')
end
close(Fig);
DlgH = figure;
for k = 1:4
thumb = imread(fullfile(tempdir, sprintf('Fig%d.png', k)));
AxesH(k) = subplot(2, 2, k, 'Visible', 'off');
image(AxesH(k), thumb, 'ButtonDownFcn', ...
{@myOpen, fullfile(tempdir, sprintf('Fig%d.fig', k)})
end
function myOpen(ImageH, EventData, FigFile)
openfig(FigFile);
end
The dialog can be adjusted easily to be scrollable vertically and/or horizontally. You can adjust the size and number fo the subplots, show a larger preview etc. This is much simpler than using the Windows Explorer for something, which it is not designed to do.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Printing and Saving finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!