Proportional text font size, or editing font size when figure resize occurs?

I've had some problems with this, and after looking online I've never really had a satisfactory answer to this.
What I want to do with my gui is set the static text size to a default size on a 720p monitor, with preset a figure position. I consider this my default, if the user has a different resolution, the text size is changed appropriately. I can get literally EVERYTHING else to change proportionally, and there isn't a problem with it. Text though is just a nuisance.
I would appreciate any advice on how to do this intelligently. I can manually resize the text size and wrap it if needed, but I want a fast, elegant way to do it dynamically on resize without manual processes. Is this possible?

 採用された回答

Dishant Arora
Dishant Arora 2015 年 4 月 15 日
get(0 , 'ScreenSize') % Gives the default screen size in pixels
get(0 , 'ScreenPixelsPerInch') % Gives the default Resolution
And if you want to get screen size in inches:
set(0 , 'Units' , 'Inch')
Hopefully this might help you

3 件のコメント

Brian
Brian 2015 年 4 月 15 日
Thanks, I knew how to do this before though, I was wondering how this can be done automatically on resize.
As in, I resize the figure, and it does this automatically. I can resize the figure with another functions callback, but I have to initiate that manually. As in, I resize, push a button, then its fine.
Is there a way to initiate this resize automatically? Or set the properties such that they resize themselves?
Check out the doucmentation for windows resize callback function.
fun = @newfig;
figure('ResizeFcn' , fun);
function newfig(src , event)
% Your Code
end
Brian
Brian 2015 年 4 月 22 日
編集済み: Brian 2015 年 4 月 22 日
Sorry, didn't get an email so I thought this went dead. I'll check the documentation, again thanks for this. It seems to be exactly what I need.
I've just recently branched out from GUIDE, so I'm still getting used to programmatic UI's.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraphics Object Properties についてさらに検索

質問済み:

2015 年 4 月 15 日

編集済み:

2015 年 4 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by