Tag Archives: example

Rename files after their modification dates in C#

Lately I’ve been creating one file a day and I wanted to rename the files after their modification dates. Something like “File 04-01-20.jpg.” So I wrote this program to do that. Enter the directory that you want to search, a … Continue reading

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

Find a Ducci sequence in C#

A Ducci sequence is a sequence of tuples of integers. You start with a sequence of values such as 1-2-3-4-5. TO find the next tuple, you calculate the absolute value of the difference between adjacent numbers in the sequence, wrapping … Continue reading

Posted in algorithms, mathematics | Tagged , , , , , , , , , | Leave a comment

Encode and decode Futurama’s alienese in C#

My last two posts explained a program can pull out pieces of an image. In those examples, the image was a collection of glyphs and the program saved the individual glyphs in png files. This post uses the glyphs to … Continue reading

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

Separate glyphs in an image in C#, Part 2

This is the second post describing the program that I wrote to separate glyphs in a combined image. The first post explained the program’s menus. This post explains how the program manages its red glyph selection rectangle. This post describes … Continue reading

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

Separate glyphs in an image in C#, Part 1

I’m working on a program to translate to and from Futurama’s alienese alphabet. Before I do that, I wrote this program to separate glyphs stored in an image that contains the alphabet. It’s a fairly full-featured program, so I’ll describe … Continue reading

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

Videos vs Animated GIFs – Pros and Cons

The modern web and mobile applications are rich in media content because it’s one of the crucial things that keeps the user engaged. An image is worth a thousand words, and a video is worth a million. Obviously, meaningful animated … Continue reading

Posted in graphics, multimedia, web | Tagged , , , , , , , , | Leave a comment

Graph points in WPF and C#

This example extends the previous example Draw a graph in WPF and C# to draw ellipses marking the data sets’ points. See that example for an explanation of how most of the program works. The following code shows how the … Continue reading

Posted in algorithms, drawing, geometry, graphics, mathematics, wpf | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Search files for target text in C#

The .NET tools available in the System.IO namespace and normal string methods make it easy to search files for target text. When you click the Search button, the following code displays the lines in a file that contain a particular … Continue reading

Posted in files | Tagged , , , , , , , | Leave a comment

Write Console window output to multiple places in C#

This example captures output sent to the Console window and displays it in multiple controls plus the Console window. It is based on an excellent reply by user Servy on Stack Overflow. The following class is a TextWriter that represents … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment

Redirect Console window output to a TextBox in C#

This example captures output sent to the Console window and displays it in a TextBox control. It is based on an excellent reply by user Servy on Stack Overflow. The Console object has a SetOut method that lets you change … Continue reading

Posted in console | Tagged , , , , , , , , | 1 Comment