Tag Archives: example program

Revised: Graph world total COVID-19 cases, deaths, and recoveries in C#

This post revises the example Graph world total COVID-19 cases, deaths, and recoveries in C#. Ulrich Rosin left a comment on that post. He added a seven-day average. He also displayed tick marks for the beginning of each month instead … Continue reading

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

Create button images in WPF and C#

It seems like I’m constantly building programs like this one to create simple button images that I can use in other programs. This example uses XAML code to create some simple button images. The program’s code then saves those images … Continue reading

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

Overlay parts of images in C#

My previous post Brighten pixels in an image in C# lets you brighten certain pixels in an image. Unfortunately is often brightens pixels outside of the area that you want to modify. For example, in the left side of the … Continue reading

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

Brighten pixels in an image in C#

Sometimes when I take a picture, the poor lighting makes some pixels come out less brightly than I would like. For example, in the picture on the right the red raspberries aren’t very red. This example lets you brighten pixels. … Continue reading

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

Perform binary contrast enhancement more quickly in C#

The example Perform binary contrast enhancement interactively in C# lets you convert an image into completely black and white pixels depending on their brightness. Pixels that are brighter than a given cutoff value are converted into white. Those that are … Continue reading

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

Save a RichTextBox image in C#

My post Get the image of a control or form, or a form’s client area in C# uses a control’s DrawToBitmap method to make it draw itself onto a bitmap. Unfortunately the RichTextBox control does not support that method. Another … Continue reading

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

Expand a ComboBox when the user presses Enter in C#

A ComboBox control’s DropDownStyle property determines how it lets the user select values. The three possible DropDownStyle values are: Simple – The ComboBox displays a text box (where the user can type a value) and a list (where the user … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , | Leave a comment

Make a blended composite image in C#

The other day I wanted to do something that all of us do from time to time: make a composite image with the Eye of Sauron on top of another picture. This turned out to be a bit more complicated … Continue reading

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

Crop scaled images to a desired aspect ratio in C#

I often need to crop images and sometimes I want a specific aspect ratio. (In case you haven’t heard this term before, the aspect ratio is the ratio of the image’s width to height. As an equation, it’s width / … Continue reading

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

Colorize images in C#

This example produces some impressive results, but it’s actually quite simple. It uses ImageAttribute techniques demonstrated by several other examples to quickly manipulate an image’s colors. Adjust Color The following AdjustColor method starts the process of coloring an image. // … Continue reading

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