Home > Software engineering >  Definition Dotnet MAUI "device-independent" unit of measure
Definition Dotnet MAUI "device-independent" unit of measure

Time:10-26

Can someone point me to an article explaining the definition of a "device-independent" unit of measure? I am coming up dry.

CodePudding user response:

Based on Xamarin Docs (Since there is not documentation of this on dotnet maui) the "device-independent" units of measure are used as a standard for measurement of the same kind of quantity. Some values are default but You could set those in different controls (using CharacterSpacing / RowDefinition / ColumnDefinition / etc )

CodePudding user response:

With the introduction of WPF, Microsoft began using DIU (Device Independent Units). A DIU (also known as a Device Independent Pixel, or DIP) measurement is based on inches rather than hardware-specific pixels. A DIU is defined as 1/96 of an inch (smaller than the point, which is defined as 1/72 of an inch). For a standard 96 pixel per inch monitor, 96 DIU = 96 pixels. For monitors with 120 pixels/inch, 96 DIU = 120 pixels. For a monitor with 60 pixels/inch, 10 DIU = 60 pixels. When the measurement doesn't work out to a perfectly round number (as is often the case), WPF will automatically use anti-aliasing, or you have the option of “snapping” to the nearest pixel if you don't want "fuzzy" outlines for your button, etc. For more information about WPF, you can refer to the link: "https://learn.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/wpf-graphics-rendering-overview?redirectedfrom=MSDN&view=netframeworkdesktop-4.8".

  • Related