Project #6 - Paint - 15% - Author: Ravi Chugh
due midnight, U Feb. 26 R Mar. 2

Please read the class programming standards and the GUI testlist.

Deduction for lateness is 10% per day for 5 days, then no credit.  Start early!

version 1.1, last updated 08/07/2006

For our last assignment, we will make use of .NET’s library of 2D graphics functions, GDI+, to implement a simple a Paint-like program.  The required features are specified below, but there will also be a large number of extra credit additions you can make, some of which are listed below and others are up to you.  Making a polished and useful graphics-editing application can be very complicated, so it is up to your ambition what kinds of additional features you’d like to add.

Your GUI design will also be very important for this assignment.  My sample program (download) offers a possible GUI structure, but you are free to choose whatever design you’d like that you think will make the user’s experience the most successful.  Remember to incorporate all of the required features into your design.  Here's a screenshot of my program:

Your Paint program should have a fixed canvas size (of a reasonable size of your choosing) and the following tools:

1) Pencil

2) Spray Paint

3) Ellipse Shape

4) Rectangle Shape

5) Erase

 Your paint program should also allow the user to Save, Save As, and Open canvases.

 

Pencil

Your pencil should draw circles on your canvas whenever the mouse is down and is being dragged around the canvas.  The size and the color of the pencil’s trail should be user-controlled parameters.

 

Spray Paint

The spray paint tool should draw circles on the canvas whenever the mouse is down and is being dragged around, but the circle should not be completely filled in.  The density of the spray should be controlled using random numbers, and the relative density of the spray should be user-controlled (ie, there should be at least two states for the spray density, like LOW and HIGH).  The color and size should also be user-controlled.

 

Ellipse Shape

The rectangle enclosing the ellipse to draw should have a corner where the mouse is first clicked and its diagonally-opposite corner at the point where the mouse is released.  The user should be able to choose from three options: stroke only, stroke and fill, and just fill.  The stroke and fill colors should be user-controlled.

 

Rectangle Shape

This tool’s behavior should be analagous to the ellipse tool.

 

Eraser

This should work just like the pencil, but the color of the trail should be white, the background color of your canvas.

 

Hints and Sample Code

  1. Here are my images (downloadable, created by Shruti Shah) if you'd like to use them.  They include those shown below:

  1. Here is sample code that paints lines and an ellipse:

  1. Here is sample code that  paints an icon in the system tray with the current date.  Screen shots for these apps are below:

Extra Credit

Possibilities include:

You may also add other features that you think would be useful to have.  Realize that any extra feature you add will not necessarily give you extra credit.  Ask me about it if you’re unsure.

GOALS:

  1. To practice using GDI+ graphics.
  2. To practice keeping complex program state.

GETTING HELP:
If you need help, try (in preferred order):

  • posting to the Discussion Group in Blackboard
  • call or find me or a TA
  • send email (last resort)

TURN-IN:
The turn-in procedure for programming assignments is as follows:

  1. Please turn in a zipped folder containing the Paint application.
  2. Create a folder with your PennNetID as its name (for example, "pgpalmer".  Place all needed files into this folder.
  3. Test unarchiving the zip file to make sure it produces all your files, but in whatever folder the person unzipping chooses (such as, on the Desktop).
  4. If correct, log into Blackboard and turn in the zip file (via file upload in your web browser).  Be sure to select "Send File" (and not "Add File") in Blackboard's Drop Box.

Visitors:  Hit Counter