WPF measurement system, wpf Measurement
Different from Winform, the measurement unit bit of WPF is not a pixel, but a DIU with no relevance for the parameter. Its size is always 1/96 inches.
In WPF, how many pixels is a 96-degree-based worker?
A: The system DPI is determined.
Calculation formula: Real pixel = Setting irrelevant size * system DPI
In this case, when the DPI of the system is 96 (windows silence value), the CPU usage is exactly 96 pixels. When the DPI of the system is 120, the system will occupy 120 pixels.
The pixel size is available, and the screen DPI can be known to calculate the physical size.
The screen DPI depends on the screen size and resolution.
For example, in the 12.5, the screen DPI of 1366*768 is about 125 dpi; In the 18.5, the screen DPI of 1366*768 is about 85 dpi.
If it is not calculated, the length of 96 pixels in the pixel book is smaller than 1 inch, and the size of 96 pixels on the camera will be greater than 1 inch.
Generally, the LCD display device has a natural resolution. The screen DPI can be fixed because the display effect is the best.
Consider the screen DPI as hard DPI (not much changed), and the front system DPI as hard DPI (which can be modified in the control panel ).
When so many metrics exist, where are the thresholds of the WPF metric system?
A: If the DPI of the system is used by the hacker, the WPF measurement system is different from that of Winform. For this reason, the measurement units of WPF are equivalent to pixels, and the two tables are exactly the same.
However, when the DPI of the system is changed, the WPF firmware is displayed.
For example, when the DPI of the system is increased to 120, WPF automatically increases the pixel size to show more metrics. When the browser is directly connected, the control increases, zookeeper is clearer.
At this time, the dimension of Winform cannot be automatically changed. It is still the same as the old ones. Although the system provides a higher pixel density, however, the Winform resolver cannot display more than one operator.
However, this method of WPF may also cause problems. For example, if the coverage of a specified window is 1366, it is okay in the system DPI that is recognized by the system, however, if the system DPI is added, the window will go beyond the screen.
At this time, winform's fixed pixel method won't be a problem, so the advantages and disadvantages also depend on the scene.
What is the role of wpf special effects in xp? If all windows XP systems are used, is C # windows form development or wpf Development recommended?
Useful. Install the. NET 3.5 environment .. That is to say, the WPF program you developed must install. NET3.5 to run in XP!
Windows Forms applications can also use the WPF effect. Windows Forms applications, and a WPF interoperability,
In the toolbox, you can see
For Windows applications, if you want to use WPF, I will do this. Use WPF to set UserControl .. User Control ..
Then, drag the user control to the application.
In wpf, when DoubleAnimation is used to change the size of a Button, where is the initial size of the Button stored by the system?
The built-in Dependency Property System of WPF saves the original value.
Animation is based on dependency attributes.
If you have written dependency attributes, You should know a problem in value force.
For example, the Slider control, its Minimum, Maximum, and Value attributes (essentially encapsulation of corresponding dependency attributes ),
It cannot force you to set which one, if you set: Minimum = 0, Maximum = 10, Value = 4
Then set Minimum = 5. At this time, the Value is automatically set to 5. If you set Minimum = 0, the Value is changed back to 4 because the dependency attribute system will save the original Value, at the same time, use the dependency attribute force to modify the value.
In addition, the pre-animation size you mentioned in the question.
You can use the GetAnimationBaseValue method.
Example: myButton. GetAnimationBaseValue (Button. WidthProperty)