Monthly Archives: September 2018

Initialize TextBox contents for the computer’s locale in C#

Suppose you place numeric, currency, date, and time values in TextBox controls at run time. At design time, the program may have trouble reading those values if the computer running the program is not using the same locale that you … Continue reading

Posted in formatting, internationalization, localization | Tagged , , , , , , , , | Leave a comment

Use label controls to draw a simple labeled histogram in C#

The example Draw a simple labeled histogram in C# draws a labeled histogram on a PictureBox in that control’s Paint event handler. It does a fair amount of work to ensure that the histogram’s bars are in their proper positions … Continue reading

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

Draw a simple labeled histogram in C#

The example Make a simple histogram in C# shows how to draw a simple histogram on a PictureBox. This example adds Label controls above the histogram’s bars. When the program loads, it uses the following code to generate some random … Continue reading

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

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