Assignment 9
Up Assignment 1 Assignment 2 Assignment 3 Assignment 4 Assignment 5 Assignment 6 Assignment 7 Assignment 8 Assignment 9 Assignment 10

 

Graphical User Interfaces: A Paint Program

Due: Friday, Nov 30, 5:00 PM

This assignment tests your ability to do more advanced things with GUI's, as discussed in Chapter 12, as well as some simple graphics operations, as discussed in Chapter 16.

Your task is to modify Example 12.34 in the text, in the following ways:

Instead of drawing on the form, you should place a panel in the form, and draw on it.
 
You should add two sets of radio buttons: one that allows the user to select a color, and the other to select a "brush width" (say fine, medium, and broad).  Set the default button (i.e. the one that is initially selected when the program begins) to be the top button in each group.
 
You should modify the graphics strategy so that, as the mouse is moved, a smooth line of the right width and color appears on the screen.
 
You should provide a button to clear the graphics in the panel.

Extra credit:

Provide an extra radio button for colors, labeled "Custom", which when pressed invokes a ColorDialogue box.
 
Instead of radio buttons for the width, use a TrackBar (i.e. a slider) to set the width to be any number within some range.