MaxGUI automatic scaling

I’m looking for a solution about automatic scaling in MaxGUI applications.
If you write an application with a window of 400×300 pixels, this will keep the same even on a HD display of 1920×1080 pixels. But it will hard to read the gadgets!!!!

So I’m thinking to hacking MaxGUI adding some new features to automatic handle this situation.

The first step is to create a ‘default’ resolution: in my case I decided that it will be 1024×768 pixels, the actual resolution of my own screen.

When MaxGUI starts, it should check if the current resolution ratio is like the default one or not.

So the first check is a simple DesktopWidth()*DesktopHeight() = my_default_area

If the check is false, we need to recalculate a correction-ratio.

So in my case A1 (default area) is 1024×768 = 786.693 pixels.

My app has a window of 400×300 pixels (A2) = 120.000 pixels.

My default_Ratio is 120.000/786.693 = 0,1525

If I run my application in a higher desktop (like 1920 x 1080) this ratio will be different.

120.000 / (1920×1080) = 0,0578 and this means that my app look ‘smaller’ on the screen.

So the solution is to find this correction-ratio and apply it on every gadgets and on the window itself.

Cwidth=1920/1024 = 0,1915403032721468475658419792498
Cheight=1080/768 = 1,40625

The new window area will be 400*Cwidth x 300*Cheight = 32322,375 pixels, and the area/ratio will be 0,1558 (quite similar to the original aspect ratio).

So I need to apply to positions and sizes of gadgets and windows these correction-ratios, in an automatic and transparent way to the user.

 

 

 

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close