workingArea

버전 1.0.0 (2.82 KB) 작성자: Paul Mennen
Returns the size and position of the area of the screen where you can place figures without obscuring the taskbar.
다운로드 수: 8
업데이트 날짜: 2021/5/22

라이선스 보기

Suppose you want to create a small figure window at the upper-left corner of the screen and another one at the lower-right corner. The obvious way to do this is to get the screen size using get(0,'screensize') and use that to position the figures. Using that method, one of those figures would cover part of the taskbar which would not likely be your intention. To do this properly you need to query for the location and size of the screen working area (i.e available area not occupied by the task bar). One way to do this is to use this sequence:
a = figure('WindowState','maximized'); pause(.1); get(a,'outerposition')
One problem with that method is that is hard to be sure how long a pause is required. (It doesn't work without the pause.) And even if you immediately delete or resize the figure you will still see the screen flash unnecessarily. Another problem with that method is that it will only work on Matlab version R2020a or newer. For older versions of Matlab, the same thing could be done using the JavaFrame undocumented feature, but that won't work with even older versions of Matlab or with Octave. This function solves that problem by returning the screen working area without needing to create a dummy figure window and it works across all Matlab versions (and even Octave).
Unfortunately this function has only been tested under Windows 10 and probably would need substantial modification to work under Linux or Mac OS.
Type "help workingArea" to see eight examples of using this function to create figure windows of various sizes and positions.

인용 양식

Paul Mennen (2024). workingArea (https://www.mathworks.com/matlabcentral/fileexchange/92688-workingarea), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2021a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
태그 태그 추가

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0