Different Pixel Density in wxWidgets Topic is solved
Different Pixel Density in wxWidgets
Hi all,
i was just wandering if wxWidgets takes screen size into account when a control is created, for example
if i create a gui with a number of check boxes and radio button etc, would the check boxes and radio buttons
automatically resize for a 4k or 8k display in the sense that it would need more pixels to look the same size
on a screen with a bigger resolution ?
i realize that i do need to resize bitmap buttons and normal buttons though.
tnx
i was just wandering if wxWidgets takes screen size into account when a control is created, for example
if i create a gui with a number of check boxes and radio button etc, would the check boxes and radio buttons
automatically resize for a 4k or 8k display in the sense that it would need more pixels to look the same size
on a screen with a bigger resolution ?
i realize that i do need to resize bitmap buttons and normal buttons though.
tnx
Last edited by Ambush on Fri Jul 07, 2017 1:26 pm, edited 1 time in total.
Re: Different resolutions in wxWidgets
i just rememberd that wxWidgets uses windows native controls so i am guessing that
windows will make the checkboxes look right on 4k or 8k screens, can anyone confirm this ?
windows will make the checkboxes look right on 4k or 8k screens, can anyone confirm this ?
Re: Different resolutions in wxWidgets
First of all, the width*height resolution is not relevant, it's only about the pixel density (DPI/PPI).
In order for native controls to get a correct size, two conditions must be met:
a) When creating the controls, you must not pass an explicit size, but use wxDefaultSize
b) Your application must be marked as "dpi aware" though its manifest
https://blogs.msdn.microsoft.com/chuckw ... t-madness/
( under "High-DPI" )
In order for native controls to get a correct size, two conditions must be met:
a) When creating the controls, you must not pass an explicit size, but use wxDefaultSize
b) Your application must be marked as "dpi aware" though its manifest
https://blogs.msdn.microsoft.com/chuckw ... t-madness/
( under "High-DPI" )
Use the source, Luke!
Re: Different resolutions in wxWidgets
tnx v much doublemax
so different size values are only needed for custom drawn controlls to look right on higher density screens.
so different size values are only needed for custom drawn controlls to look right on higher density screens.
Re: Different Pixel Density in wxWidgets
Shouldn't (well-written) custom controls be also DPI aware? E.g., wxWindow has several methods to assist with that, see its methods containing words "DIP" or "ScaleFactor".
There is also an issue of per-monitor DPI awareness, there is a PR for it though: https://github.com/wxWidgets/wxWidgets/pull/334
There is also an issue of per-monitor DPI awareness, there is a PR for it though: https://github.com/wxWidgets/wxWidgets/pull/334
Re: Different Pixel Density in wxWidgets
thanks PB
i will def look at the dip and scalefactor, the sizing was bugging me a bit and
i was not enjoying the thought of having to try and work out multiple sizes for the custom stuff.
i will def look at the dip and scalefactor, the sizing was bugging me a bit and
i was not enjoying the thought of having to try and work out multiple sizes for the custom stuff.
Re: Different Pixel Density in wxWidgets
I have the same issue when I tried to run my GUI app on recommend resolution 2880 x 1800 Windows 10. It works fine. but when I change the resolution into low like 1920 x 1200 It did not display the whole screen. Is any way to fix it without using scrolled bars or windows.
Re: Different Pixel Density in wxWidgets
Hi,
Did you use default position and size along with the wxSizer API?
Thank you.
Did you use default position and size along with the wxSizer API?
Thank you.
Re: Different Pixel Density in wxWidgets
Yes, I am using wxFlexGridSizer and wxDefaultPosition, wxDefaultSize.
Re: Different Pixel Density in wxWidgets
Hi,
Did you use the same on the main frame object? Can you shouw the constructor of it and how you call it from the application OnInit() class?
Thank you.
Did you use the same on the main frame object? Can you shouw the constructor of it and how you call it from the application OnInit() class?
Thank you.
Re: Different Pixel Density in wxWidgets
Code: Select all
#include "MY_GUIApp.h"
//(*AppHeaders
#include "Guiboard.h"
#include <wx/image.h>
//*)
IMPLEMENT_APP(MY_GUIApp);
bool MY_GUIApp::OnInit()
{
//(*AppInitialize
bool wxsOK = true;
wxInitAllImageHandlers();
if ( wxsOK )
{
Guiboard* Frame = new Guiboard(0);
Frame->Show();
SetTopWindow(Frame);
}
//*)
return wxsOK;
}
Last edited by doublemax on Fri Apr 20, 2018 9:02 pm, edited 1 time in total.
Reason: Added code tags
Reason: Added code tags
Re: Different Pixel Density in wxWidgets
Hi,
And the constructor of Guiboard class?
Also, please use "code" tags so that people can easily read the code you posted.
Thank you.
P.S.: BTW what compiler do you use?
And the constructor of Guiboard class?
Also, please use "code" tags so that people can easily read the code you posted.
Thank you.
P.S.: BTW what compiler do you use?
Re: Different Pixel Density in wxWidgets
Can you show a screenshot?
The way i understand it, you just changed the display resolution to 1920x1200, but left the display scaling as it was before? If there is just enough room on the screen to display your gui at that resolution, there is nothing you can do about it.
The way i understand it, you just changed the display resolution to 1920x1200, but left the display scaling as it was before? If there is just enough room on the screen to display your gui at that resolution, there is nothing you can do about it.
Use the source, Luke!
Re: Different Pixel Density in wxWidgets
The issue that I am working on windows 10 with 2880 x 1800 resolution. when I run it on VM or Microsoft surface which the resolution is lower. So the GUI app looks bigger and did not display all its information.doublemax wrote:Can you show a screenshot?
The way i understand it, you just changed the display resolution to 1920x1200, but left the display scaling as it was before? If there is just enough room on the screen to display your gui at that resolution, there is nothing you can do about it.
Re: Different Pixel Density in wxWidgets
It is big one with a lot of details to copy here which information exactly you need from it?ONEEYEMAN wrote:Hi,
And the constructor of Guiboard class?
Also, please use "code" tags so that people can easily read the code you posted.
Thank you.
P.S.: BTW what compiler do you use?