How to output the application screen as an image or PDF on the web app

3 ビュー (過去 30 日間)
TRyo
TRyo 2022 年 12 月 2 日
回答済み: Amith 2024 年 8 月 22 日
I am creating a web application.
After using the application on the web, I would like to save the application screen (UIFigure) as an image or PDF.
Do you have a good method?
I can use exportapp and imwrite on the app designer, but I can't use it on the web.

回答 (1 件)

Amith
Amith 2024 年 8 月 22 日
Hi TRyo,
The exportapp function is not supported in MATLAB Online or Web Apps.
The getframe function does not support the following features in MATLAB Online or Web Apps:
  • Capturing the contents of a figure created with the uifigure function or any axes within that figure.
  • Capturing the contents of an app created with App Designer or any axes within that app.
However, exportgraphics is supported in Web Apps. To use it, you should follow these steps:
exportgraphics(axes, filename);
web(filename)
The file is then downloaded to your browser's default download location.
For more information about this method, you can refer to this MATLAB Answer:https://www.mathworks.com/matlabcentral/answers/1932575-screenshot-of-matlab-web-app
Hope this helps!

カテゴリ

Help Center および File ExchangeDevelop uifigure-Based Apps についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by