Free App Resolution

What is meant by a free application for permission. Since I discussed this with many of my friends, and they say that permission for free means that the ever allowing user wants to see the application, should he adjust his position, resolution is the resolution of the monitor, or does anyone say 100 to 100, what is permission?

+4
source share
5 answers

I think this means that the proportions should be the same, with different resolutions. This does not mean that the application will resize its windows inside to adapt to the new resolution. But this is not universal.

Another important thing to mention is the context in which this occurs. For example, there are different expectations for a web application , which can change the layout size or page size depending on the resolution. Video games that can do things very differently depending on screen resolution and aspect. And the usual Windows applications (GUI), which I already spoke about.

0
source

Ideally, applications will use a higher pixel density to show more detail. For example, a high-resolution monitor may display icons on the toolbar of the same size, but use additional pixels to render sharper graphics. This way you can keep the same basic layout, but offer more clear and detailed information. For various reasons, this decision was not possible in the past. Although you can resize graphic content that is drawn using GDI / GDI +, User32 (which generates visual effects for common controls) does not support true scaling.

WPF does not suffer from this problem because it displays all user interface elements, from simple forms to ordinary controls, such as buttons. As a result, if you create a 1-inch-wide button on a computer monitor, it can remain 1 inch apart on a high-resolution monitor. WPF will simply display it in more detail and with more pixels.

WPF bases its scaling on the DPI setting of the system, not the DPI of your physical display device. It uses the DPI setting of the system when calculating sizes.

WPF Units

The WPF window and all elements within it are measured using device-independent devices. A single device-independent unit is identified as 1/96 of an inch. To understand what this means in practice, you need to consider an example.

Imagine you are creating a small button in WPF that is 96 by 96 units in size. If you use the standard Windows DPI setting (96 dpi), each device-independent block corresponds to one real physical pixel. This is because WPF uses this calculation:

[Physical Unit Size] = [Device-Independent Unit Size] × [System DPI] = 1/96 inch × 96 dpi = 1 pixel 

In fact, WPF assumes that it takes 96 pixels to make an inch, because Windows reports that through the DPI setting of the system. However, the reality depends on your display device.

For example, consider a 20-inch LCD monitor with a maximum resolution of 1600 by 1200 pixels. Using the Pythagoras dash, you can calculate the pixel density for this monitor, as shown below:

 [Screen DPI] = ((Sqroot of)(1600*1600)+(1200*1200))pixels/19 inches = 100dpi 

In this case, the pixel density reaches 100 dpi, which is slightly higher than Windows suggests. As a result, the 96-by-96-pixel button on this monitor will be slightly less than 1 inch.

On the other hand, consider a 15-inch LCD monitor with a resolution of 1024 by 768. Here, the pixel density drops to about 85 dots per inch, so the 96-by-96 button is a little more than 1 inch.

In both cases, if you reduce the size of the screen (for example, switching to a resolution of 800 by 600), the button (and every other screen element) will seem proportionally larger. This is because the DPI system setting remains 96 dpi. In other words, Windows continues to assume that 96 pixels are required per inch, although lower resolution requires much fewer pixels.

Link: Pro WPF in C # 2008: Windows Presentation Foundation with .NET 3.5, Second Edition

+3
source

WPF uses device-independent coordinates, which means that applications scale correctly and evenly with different DPI settings.

Another very useful feature of WPF is the ViewBox, which can be used to create a scalable application. Try the following.

 <Window x:Class="WpfApplication2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="300" Height="300"> <Viewbox Stretch="Uniform"> <Grid Width="300" Height="300"> <Button Content="Button" Margin="16,8,0,0" Width="104" Height="32" HorizontalAlignment="Left" VerticalAlignment="Top" /> <CheckBox Content="CheckBox" Margin="136,8,0,0" Width="112" Height="24" HorizontalAlignment="Left" VerticalAlignment="Top" /> </Grid> </Viewbox> </Window> 

This simple example is a small reason for the window title and window border, but you get the idea. When this window is resized, the content scales evenly, so it looks the same at any resolution.

+2
source

You can use WPF for your application. Each control you create on the form will have different screen resolutions.

One of the main declared benefits of WPF is its "independence of resolution." Often this advantage is described in relatively vague terms, leading people to believe that this means that the same WPF window will be displayed on any monitor of the same size, regardless of the resolution on which this monitor is installed.

+1
source

Source: https://habr.com/ru/post/1308320/


All Articles