Monthly Archives: July 2015

Pixellate parts of an image in C#

This program lets you click and drag to select an area and pixellate the area. The code that lets you select an area is interesting but reasonably straightforward. See the code and the example Use a rubberband box to let … Continue reading

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

Make a closeup map in C#

This example makes a closeup map that shows an enlarged area under the mouse as you move it across the map. The program stores an enlarged version of the map in the hidden PictureBox named picHidden. When the mouse moves, … Continue reading

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

Set the pixels in a WPF bitmap in C#

This example shows how you can manipulate the pixels in a WPF bitmap. One of the things I like least about WPF is the way Microsoft threw away everything we had learned over years of working with Visual Studio. Yes, … Continue reading

Posted in graphics, image processing, wpf, XAML | Tagged , , , , , , , , , , , , , | 6 Comments

Recursively perform red eye reduction on a picture in C#

The example Perform red eye reduction on a picture in C# examines the pixels in a selected rectangle and converts any pixel that is more red than green or blue into grayscale. That removes red eye in the area but … Continue reading

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

Perform red eye reduction on a picture in C#

This example shows one approach for performing red eye reduction. Sometimes in a picture the eyes of a person or animal come out bright red. It’s an annoying effect caused by the camera’s flash bouncing off of the person’s retina. … Continue reading

Posted in algorithms, graphics, image processing | Tagged , , , , , , , , , , , , | 5 Comments

Manage the recycle bin (wastebasket) in C#

You can use API functions to manage the recycle bin, but some operations are much easier if you use the Microsoft.VisualBasic library. You can use the API if you like, but I’d rather do things the easiest way possible to … Continue reading

Posted in files, system | Tagged , , , , , , , , , , , , , , , , | 1 Comment

Use WMI to get operating system information in C#

When the program starts, it executes the WMI query SELECT * FROM Win32_OperatingSystem. It loops through the results and calls subroutine GetValue for each of the many system parameters that should be available. The following code shows just a couple … Continue reading

Posted in system, WMI | Tagged , , , , , , , , , , , , , , , | 1 Comment

Zoom and scroll a picture drawn in C#

This program lets you zoom and scroll a picture drawn by the program. The program contains a Panel with AutoScale set to true. Inside the Panel is a PictureBox with SizeMode set to AutoSize. The PictureBox contains a Bitmap that … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , , , , , | 2 Comments

Format DataGridView columns in C#

This example shows how you can format DataGridView columns to make them display values properly. The control is actually pretty smart and will usually do the right thing if you give it the right data. For example, if a column … Continue reading

Posted in controls | Tagged , , , , , , , , , , , | 2 Comments