Tag Archives: select area

Select rectangular areas in an image in WPF and C#

This is another fine example of WPF’s unofficial slogan: Twice as flexible and only five times as hard. Practically everything about this example is harder than it is in Windows forms: drawing the rectangle, selecting the area, saving the results … Continue reading

Posted in graphics, wpf | Tagged , , , , , , , , , , , | Comments Off on Select rectangular areas in an image in WPF and C#

Use a rubber band box to let the user select an area in a picture in C#

The following shows the program’s startup code. private Bitmap m_OriginalImage = null; private int X0, Y0, X1, Y1; private bool SelectingArea = false; private Bitmap SelectedImage = null; private Graphics SelectedGraphics = null; // Save the original image. private void … Continue reading

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

Let the user select rectangular areas in an image in C#

This program lets the user click and drag to select rectangular areas in an image. The program starts by defining a couple of variables that it uses while selecting the area. // The original image. private Bitmap OriginalImage; // True … Continue reading

Posted in graphics | Tagged , , , , , , , , , | 9 Comments