Tag: dpi

  • SetDPI Utility Version 2

    View source on GitHub. A couple of years ago I made a small command-line program for setting the DPI/PPI of PNG files. I used the System.Drawing.Bitmap class (i.e. GDI+) to set this property, which had the unfortunate side effect of producing relatively bloated files. Given that the chunk specifying this property is only 21 bytes…

  • Retaining DPI/PPI Information with PNGGauntlet

    I’ve mentioned PNGGauntlet many times on this blog – it’s a great tool for squeezing the best compression ratios out of the PNG format. It combines the tools PNGOUT, OptiPNG and DeflOpt in a nice WinForms GUI. As part of the compression process, most chunks are removed by default. This includes the pHYs chunk, which…

  • Pixel-perfect Multi-DPI Images in WPF (Part 3)

    View source on GitHub. In Part 1 of this series, I discussed the problem of displaying different bitmap images at different DPIs in WPF. In Part 2, I proposed a solution using multi-frame TIFFs and two simple markup extensions. In this final post I will present a basic program that takes multiple images (PNG recommended),…

  • Pixel-perfect Multi-DPI Images in WPF (Part 2)

    View source on GitHub. See also: Part 1 and Part 3. In Part 1 of this series, I explored the issue of displaying pixel-perfect bitmap images in the Windows Presentation Foundation. In this article, I’ll describe a method of displaying different images depending on the system DPI setting using a custom Markup Extension and multi-image…

  • Pixel-perfect Multi-DPI Images in WPF (Part 1)

    View source on GitHub. See also: Part 2 and Part 3. I’ve written previously about DPI-awareness in the Windows Presentation Foundation and how to specify measurements in pixels rather than Device Independent Units (DIUs). Something else to consider is image scaling – unlike the Windows Ribbon control or WinRT, WPF has no in-built mechanism for…

  • Keiki Usage Meter 3.1.0 Released

    I’ve released an update for Keiki Usage Meter. There has been a lot of behind-the-scenes work, but the user experience hasn’t changed drastically. Visit the website to find out what’s new. I’m using this program as something of a testbed for some engineering work that I’ll talk about in future posts, including supporting pixel-perfect bitmap…

  • SetDPI Utility

    View source on GitHub. Updated 2013-01-06. Ken Silverman’s PNG compression tool PNGOUT (complemented nicely by the free .NET frontend PNGGauntlet) can be remarkably effective at trimming the size of PNGs without altering the image described within. However, in its quest to remove anything non-essential, PNGOUT by default strips out the image’s DPI (in fact PPI)…

  • Pixel Measurements in WPF

    Part of the beauty of the Windows Presentation Foundation is that it is designed to be resolution independent – that is, a WPF application should scale perfectly no matter the system’s DPI setting (excluding any bitmap graphics, which mightn’t look as nice as the vector parts). Instead of measuring things in pixels, WPF uses Device…

  • Small Icon Size & DPI in Windows

    The GetSystemMetrics function in Windows retrieves system metrics and configuration settings. One such metric is the recommended size (width and height) of ‘small icons’: Small icons typically appear in window captions and in small icon view. Another place where small icons show up is the notification area. MSDN contains a guide to Creating DPI-Aware Applications.…