Monthly Archives: April 2020

Understand bitwise operators in C#

The examples Make an efficient priority queue class in C#, Part 1 and Make an efficient priority queue class in C#, Part 2 explain how to make a heap-based priority queue. Those examples use a FindMsb method that uses bitwise … Continue reading

Posted in algorithms, mathematics | Tagged , , , , , , , , , , , | 3 Comments

Make bitmap extension methods that resize bitmaps in C#

The post Resize pictures in a directory to specific widths or heights in C# lets you resize all of the pictures in a directory. This example extracts the key method that resizes files and places it in a new Bitmap … Continue reading

Posted in extensions, files, graphics | Tagged , , , , , , , , , , , , , , , , | 2 Comments

Resize pictures in a directory to specific widths or heights in C#

The post Resize pictures in a directory in C# lets you resize all of the pictures in a directory but it only scales the images. This example lets you resize pictures so they have a given width, height, or both. … Continue reading

Posted in files, graphics, image processing | Tagged , , , , , , , , , , , , , , , | 1 Comment

Use code to make a slideshow in C# and WPF

This is example shows how to make a slideshow in WPF. Unlike all of the examples I’ve seen on the internet, however, this one uses C# code rather than XAML. It’s actually fairly simple, it just took a long time … Continue reading

Posted in animation, wpf | Tagged , , , , , , | 4 Comments

Graph COVID-19 recoveries and deaths per resolution in C#

Previous examples have shown how to graph COVID-19 cases, cases per million, deaths, and deaths per million. This example graphs recoveries, recoveries per million, and what is probably the most important value deaths per resolution. The previous example showed how … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Graph COVID-19 deaths and deaths per million in C#

The previous example showed how to graph COVID-19 cases and cases per million. This example adds the ability to graph COVID-19 deaths and deaths per million. Recall that the previous example’s CountryData class used two arrays of data, Cases and … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , , , , | 1 Comment

Graph COVID-19 cases per million in C#

The example Align graphs of COVID-19 case data in C# lets you load COVID-19 case data and display it, optionally aligning different countries’ graphs on the left so they start with roughly the same number of cases. That makes it … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , | Leave a comment

Align graphs of COVID-19 case data in C#

The example Download and graph COVID-19 case data in C# shows how to graph different countries’ COVID-19 case data. The graphs are informative. For example, they can show you whether a country’s graph is upward bending or whether it has … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , | 1 Comment

Load a picture and manipulate pixels in WPF and C#

The post Easily manipulate pixels in WPF and C# explains a BitmapPixelMaker class that you can use to manipulate the pixels in an image in WPF relatively easily. That example creates the image from scratch. This post extends that class … Continue reading

Posted in graphics, image processing, wpf | Tagged , , , , , , , , , , , , , | Leave a comment

Download and graph COVID-19 case data in C#

This example shows how to download the most recent COVID-19 data and graph it. It demonstrates the following useful techniques. Downloading a file once per day Reading data from a CSV file Creating country data Using different comparers to sort … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , | 5 Comments