COP4226, Extra Credit 3
Due Friday, October 25 (not late until 6 am 10/26)
Create a Windows Forms Application in Visual Studio. The project will work with colors, pens, brushes and images.
Main Form
Add a tab control to the main form. Add three tab pages for colors, brushes and images.
Color Tab
On the color tab, add a label and a text box for entering a color. Add a button for changing the background color.
- Validate that the value entered into the text box is either a known color or a valid HTML color format of #FFFFFF. The # is required and must be followed by 6 hex digits. You may use a regular expression, if you know them.
- If the text box has a valid color, then the button should change the background color of the tab.
- Use an error provider to indicate an error.
Brush Tab
Create a brush from an image. Fill a closed curve with the brush. Create a dashed pen. Draw the edge of a closed curve with the pen.
- Create an image in the resource editor. Add several shapes of different colors. Add your first name as text in the image.
- Use the image to fill a closed curve. Use at least four points in the curve. Make the curve very "curvy".
- Draw small circles at each of the points in the curve. Use a contrasting color to the colors in your image.
- Draw the edge of the close curve with a dashed pen. Make the pen thick enough so it can be seen clearly. Use a contrasting color. Draw the curve not very "curvy", but it should not be completely straight.
Image Tab
Draw the background with a path gradient brush. Draw your image and change its color.
- Draw a path gradient brush. Use at least three colors. The colors should change from the outside of the path to the inside of the path (do not use surround colors, use the technique for linear gradient brushes). Change the center point.
- Draw your image in the tab. Draw it unclipped and unscaled. Do not draw it near the border of the tab.
- When the tab is right-clicked, open a color dialog. Initialize the color with the current background color that is shown in the image.
- When the color dialog closes change the background color of the image to the color from the dialog. Assume that the pixel in the lower left corner of the image has the background color.
Submitting Homework
Zip your entire project and upload it on the web. Exclude the
Debug and Release directories.
Submitting
Homework Online.