How to keep the size aspect ratio of GUI form fixed?

조회 수: 2 (최근 30일)
Naz
Naz 2011년 10월 18일
Hi all. I am trying to make my GUI figure to be resizable but I need the aspect ratio to be fixed. Is this possible to achieve?

답변 (1개)

Walter Roberson
Walter Roberson 2011년 10월 18일
You can put in a resize callback on the figure that changes the size to match the aspect ratio you want.
  댓글 수: 2
Naz
Naz 2011년 10월 18일
My GUI figure is called 'Vessel' and here is a code I provide for it:
function Vessel_Callback(hObject, eventdata, handles)
[x y w h]=get(hObject,'Position')
w=(4*h)/3;
set(hObject,'Position',[x y w h])
So far, it does not seem to work
Naz
Naz 2011년 10월 19일
Walter, can you give me a more explicit suggestion?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by