I've recently been working on a number of small test programs for the different sections which make up a game I'm planning on writing. One of these test systems involved a series of polyominoes which I needed to rotate. Internally, the data for these shapes are stored as a simple boolean array, which I access as though it were two dimensions. This article and corresponding source code download describe how to rotate 2D rectangular arrays (or 1D arrays that masquerade as 2D) in 90° intervals clockwise or anti-clockwise.

Continue Reading

The new exception management library I've been working on was originally targeted for .NET 4.6, changing to .NET 4.5.2 when I found that Azure websites don't support 4.6 yet. Regardless of 4.5 or 4.6, this meant trouble when I tried to integrate it with WebCopy - this product uses a mix of 3.5 and 4.0 targeted assemblies, meaning it couldn't actually reference the new library due the higher framework version.

Rather than creating several different project files with the same source but different configuration settings, I decided that I would modify the library to target multiple framework versions from the same source project, and this article describes how I did this.

Continue Reading

Last week I attended the NEBytes technology user group for the first time. One of the presentations was for Twilio, an easy to use platform for creating SMS and VoIP applications. This short article demonstrates (with a simple caveat) just how easy it is to use this platform for sending SMS messages - a perfect way of adding two factor authentication to your services, or sending alert notifications, or any number of use cases.

Continue Reading

When you reduce the number of colours in an image, it's often hard to get a 1:1 match, and so typically you can expect to see banding in an image - areas of unbroken solid colours where once multiple similar colours were present. Such banding can often ruin the look of the image, however by using dithering algorithms you can reduce such banding and greatly improve the appearance of the reduced image. This article briefly discusses dithering as a prelude to further articles with actual dithering implementations.

Continue Reading

We use batch files for... well, pretty much everything. From simple files that simple optimize modified graphics, to the tendril-like files that build our software. For some time now, I've been using cecho.exe from a CodeProject article so that I highlight errors and successes. Sadly this tool doesn't output anything if a console window isn't in use (for example from a CI server) and so I created a quick C# version for a direct replacement.

Continue Reading

The ColorGrid control is a fairly useful control for selecting from a predefined list of colours. However, it can take up quite a bit of screen real estate depending on how many colours it contains. This article describes how you can host a ColorGrid in a standard ToolStrip control, providing access to both the ColorGrid and the ColorPickerDialog, with some custom painting to show the active colour on the button to round it off.

Continue Reading