Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1211

 

Question:

Only 1920x1080 monitors are available

How can I emulate 4K resolution to adjust button and font sizes for 4K monitors?

 
Vitaly Muzichenko:

Question:

Only 1920x1080 monitors are available

How can I emulate 4K resolution to adjust button and font sizes for 4K monitors?

I thought about this while creating an EA with a panel, but got lazy. In general, the idea was to make the monitor resolution smaller and see how it would look. If it looks normal when zoomed out, it should also change normally when zoomed in.
 
Alexey Viktorov:
I once thought about this while making an EA with a panel, but got lazy. In general, the idea was to make the monitor resolution smaller and see how it would look. If it looks normal when zoomed out, it should also change normally when zoomed in.

Here's 4K and1920x1080


 
Vitaly Muzichenko:

Here's 4K and1920x1080


And if you set the resolution to 1280x720 what will these buttons be? Here's a test case.

Of course, it's easier to buy a monitor. But it is more expensive. And it is a lot of trouble to fiddle with setting the screen resolution.

Did you see an example of calculating the scaling coefficient in the documentation?

//--- создаём кнопку шириной 1.5 дюйма на экране 
int screen_dpi = TerminalInfoInteger(TERMINAL_SCREEN_DPI); // получим DPI монитора пользователя 
int base_width = 144;                                      // базовая ширина в экранных точках для стандартных мониторов c DPI=96 
int width      = (button_width * screen_dpi) / 96;         // вычислим ширину кнопки для монитора пользователя (с учётом его DPI) 
... 
  
//--- вычисление коэффициента масштабирования в процентах 
int scale_factor=(TerminalInfoInteger(TERMINAL_SCREEN_DPI) * 100) / 96; 
//--- использование коэффициента масштабирования 
width=(base_width * scale_factor) / 100;

Maybe it is not necessary to adjust and check at all?

 
Alexey Viktorov:

And if you set the resolution to 1280x720 what will these buttons be like? Here's a test case.

Of course, it's easier to buy a monitor. But it is more expensive. And fiddling with setting the screen resolution is a hassle.

Did you see an example of calculating the scaling factor in the documentation?

Maybe fitting and checking isn't necessary at all?

It does not work and there is no idea how to emulate 4K

1280х720


2560х1440


 
Vitaly Muzichenko:

It doesn't work and no idea how to emulate 4K

1280х720


2560х1440


What's not working? My fantasy about changing the screen resolution?
 
Alexey Viktorov:
What's not working? My fantasy about changing the screen resolution?

Yes, absolutely right.

Haven't tried the code yet.
 
Vitaly Muzichenko:

Yes, absolutely right.

Not tried the code yet

https://www.mql5.com/ru/forum/324812#comment_13650469

is there a topic like this?

that must be the answer:

https://www.mql5.com/ru/forum/324812/page6#comment_14073023

Использование MT5 на мониторе с разрешением 4К
Использование MT5 на мониторе с разрешением 4К
  • 2019.10.22
  • www.mql5.com
Добрый день, обращаюсь к команде разработчиков MT5. Я использую монитор с разрешением 4К размером 43”...
 
Igor Zakharov:

https://www.mql5.com/ru/forum/324812#comment_13650469

is this the kind of topic you want to highlight?

that must be the answer:

https://www.mql5.com/ru/forum/324812/page6#comment_14073023

And the discussion ended up there on the application of

TerminalInfoInteger(TERMINAL_SCREEN_DPI);
 
Igor Zakharov:
Alexey Viktorov:

And eventually the discussion there stopped at the use of

Ok, I'll look for a mon with 4K

Reason: