How to "Save As .jpg" a figure programmically?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mikael Agopov
el 20 de Mzo. de 2019
Editada: Mikael Agopov
el 26 de Mzo. de 2019
I've got a following problem: I need to automatically save figures as jpg files. This is easily done by hand
(open the File-menu, go to Save As, choose jpg image). But how to do this programmically?
Mikael
Respuesta aceptada
Jan
el 20 de Mzo. de 2019
Editada: Jan
el 20 de Mzo. de 2019
Either by
print(FigureHandle, 'C:\temp\File.jpg')
or
pause(0.02); % Magic update of java elements - don't ask me why...
F = getframe(FigureHandle);
[X, map] = frame2im(F);
imwrite(X, map, 'C:\temp\File.jpg');
1 comentario
Mikael Agopov
el 26 de Mzo. de 2019
Editada: Mikael Agopov
el 26 de Mzo. de 2019
Más respuestas (0)
Ver también
Categorías
Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!