Tag: c#
-
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…
-
Image Background Remover Tool
View source on GitHub. Inspired by Window Clippings, my preferred screenshot tool (which unfortunately crashes a lot under Windows 8 RTM), I wrote a small program for making image backgrounds transparent. It comes with a command-line interface and a basic GUI (pictured above). The GUI supports dragging-and-dropping images, and you can switch the black and…
-
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),…
-
P/Invoke and ChooseFont (Comdlg32.dll)
Mister Goodcat wrote a good article a little while ago about using P/Invoke in Silverlight 5 to display the native font chooser dialog with the ChooseFont function. I couldn’t get the code working for a 64-bit executable, however, as the definition of the CHOOSEFONT structure on MSDN he used as a basis for the managed…
-
Retrieving Windows 8 Theme Colours
See also: Windows 8 Theme Colours Reference. Windows 8 doesn’t offer developers access to system theme colours, unlike its cousin, Windows Phone. Even for a version 1 product, this seems like a strange omission. Then again, we still don’t have a working public API for retrieving the Aero glass colour (or whatever we call it…
-
Windows 7-style Notification Area Applications in WPF: Recap & Sample
View source on GitHub. Over the past month I’ve looked at how to implement a Windows 7-style notification area application in WPF. I covered 6 different topics: Part 1: Removing Border Resize Part 2: Notify Icon Position – Windows 7 Part 3: Taskbar Position Part 4: Multiple Monitors & Working Area Part 5: Fixing Aero…