Click here to Skip to main content
15,891,902 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The situation:

I developed an application that is done with winForms, the native sizes are optimized for 1920x1080 (since it's standard here).
Now i got a new laptop, same resolution and stuff but you have to set the zoom 150% to be able to see anything on that screen (dumb lenovo laptops :P).

I never thought about the zoom problem but now, as you could expect all views and screens are kinda off and display quite ugly. Fun fact, some stuff is not affected some stuff is affected.

So therefore as a quick fix until i am able to set the scaling correct, is there a way to force the native scale instead of the one + windows zoom?

Thanks in advance.

What I have tried:

Setting autoscalemode to none in the view constructor but it seems to displace the ui and it leaves its center position. Also it starts scaled and then ignores the scale and displaces itself.
Posted

1 solution

Basically, GDI+ manages everything that requires how the interface is rendered including the text, graphics and other stuff, this is managed by GDI+ and the pixel size, and the size of your font on the older laptop and the newer one are different because of different pixel density. Question: Are all the applications going through the same procedure? (Are they all not aligned?) The Window sizes are different and so are many other things and to keep the application's UI a fit for every screen, there is a team that designs how the application responds to different screen sizes, and pixel densities.

Since the problem is with the "screen with more pixels", it happened with me too, what I did was, I kept the zoom level to the same level (100%) as that is the best quality of graphics to be generated. Of course the text is small, graphics are smaller, but that is the thing of 2K graphics. :-) What I might suggest here is,

1. Provide a feature to the users where they can easily switch between 100% to 150% zoom.
2. Measure the pixel density and the screen resolution, and realign your application's controls. That is going to be tough task for any indie developer.
3. Embrace the resolution. We are used to with the old graphics and their pixel densities, the newer ones are a bit odd. I happened to fight with my LG G3 because my previous one was Samsung Galaxy Grand Neo.

Don't fight with it, soon you will get 4K, you would be doing a 300% zoom? Of course not. Not everyone shares our opinion of showing fonts to their largest possible size.

Following links will help you out in this,
How to retrieve the Screen Resolution from a C# winform app? - Stack Overflow[^]
DPI and Device-Independent Pixels (Windows)[^]
Living a High-DPI desktop lifestyle can be painful - Scott Hanselman[^]
 
Share this answer
 
v2
Comments
HobbyProggy 28-Oct-16 2:09am    
Thanks alot, will go this way :)
Karthik_Mahalingam 28-Oct-16 8:05am    
5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900