Moonglade

Modern Markdown blogging with AI-powered localization and search.

Tag: C#




Choosing the Right Monitor Size

This article provides an in-depth analysis of the critical role of PPI (Pixels Per Inch) in application development and monitor selection. Since the vast majority of desktop applications are designed based on the 96 PPI standard, using Fractional Scaling when a monitor's PPI is not an integer multiple of 96 can result in blurry images or jaggies. The article points out that when selecting a monitor, one should calculate its PPI to ensure it is close to an integer multiple of 96 (such as 96, 192, or 288), thereby achieving clear and appropriately sized text display through 100%, 200%, or 300% integer scaling. For macOS users, the 72 PPI standard should be referenced, ensuring the PPI is an integer multiple of 72. The article demonstrates how to calculate the optimal scaling ratio based on resolution and size using examples such as LG OLED, Surface Studio, and the Apple Studio Display, and provides C# code to assist in the calculation. Finally, it emphasizes that while PPI and scaling ratios are core parameters for ensuring text clarity and appropriate size, other performance metrics such as color accuracy, refresh rate, and HDR support must also be considered when purchasing a monitor. This article aims to help resolve issues of text being too large or too small and scaling blur, rather than providing a sole standard for selection.

Views 769
.NET C# Display Display Resolution Monitor Resolution


The Death of UWP: A Framework That Was Technically Successful but Commercially Failed; What Should a Modern Operating System Really Provide? ★

This article provides an in-depth analysis of the significant flaws in the traditional Windows Win32 application ecosystem, particularly concerning permission management, file system isolation, and user maintenance costs. It points out that the lack of modern sandboxing mechanisms and unified standards leads to system instability and frequent security vulnerabilities. The author argues that the UWP architecture should have been the perfect solution to these problems. Through its robust store distribution, virtual file system, strict permission controls, and automatic update mechanisms, UWP achieved a dual reduction in burden for both developers and users, while also possessing cross-platform potential. However, UWP ultimately perished due to commercial failure: initial applications were of low quality and functionally incomplete, Microsoft's own product experience was subpar, the existence of multiple implementation approaches for the same functionality led to ecosystem confusion, and high development barriers limited application scenarios. These factors ultimately caused developer attrition and market shrinkage. As Microsoft abandoned UWP and shifted towards the MAUI framework, which reverts to the Win32 model, Windows has lost an opportunity for a modern application framework. This has left behind a system characterized by functional redundancy, fragmented user experience, and difficult maintenance, which is regrettable.

Views 1,714
C# Microsoft Microsoft Store UWP Windows Windows Development




C# Play with GZip.

A extension class for string to add GZip features. Copy the following code to your project first. using System; using System.IO; using System.IO.Compression; using System.Text; public static class GZipExtensions { private static byte[] Zip(string str) { var bytes = Encoding.UTF8....

Views 280
.NET Base64 C# Compress GZip string extension