Maintain image aspect ratio on figure resize
4 ビュー (過去 30 日間)
古いコメントを表示
Hello!
I am working with a fairly complex GUI which has a logo in the upper left hand corner. Currently when the figure is resized, the image resize in direct proportion to the figure. As a result you can make really mess up aspect ratio. I tried disable stretch-to-fill, but it didn't seem to work.
Any ideas?
Thanks in advance!
0 件のコメント
採用された回答
Patrick Kalita
2011 年 5 月 31 日
I'm assuming that the logo is displayed as an image inside an axes. If that's correct and you have the handle to the axes, you can include the following statement in the code that sets up the GUI:
axis(h, 'image')
where h is the handle to the axes.
0 件のコメント
その他の回答 (1 件)
Walter Roberson
2011 年 5 月 31 日
Do not use normalized units to position the image -- or if you must use normalized units for the original positioning, change to absolute units afterwards.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Read, Write, and Modify Image についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!