Monthly Archives: August 2020

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

Test graphical transformations in C#

This example draws several pictures to let you test graphical transformations. The general approach is the same for each picture. The following section explains how the program draws the pictures that demonstrate the various graphical transformations. The sections after that … Continue reading

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