How to get the width and height of the drawable area of a window in pixels?
17 ビュー (過去 30 日間)
古いコメントを表示
I can get the figure size in pixels like this:
set(gcf,'units','normalized','position',[0 0 1 1])
set(gcf,'units','pixels')
gcf_position = get(gcf,'position');
figure_width = gcf_position(3);
figure_height = gcf_position(4);
But there is a title bar and buttons area at the top of the window, and I want to get its heigh to get the usable maximal axis height. How to do this?
0 件のコメント
回答 (1 件)
Vinayak
2024 年 5 月 17 日
The position parameter of gcf provides the values for InnerPosition, which is what you want. To include the titlebar and window boundary, you can use OuterPosition.
You can verify this at: https://www.mathworks.com/help/matlab/ref/matlab.ui.figure-properties.html
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!