YCP Logo Assignment 8: Warhol Pictures

Due: Tuesday, May 11th by 11:59 PM

In this assignment, you will create a program that tiles, flips, rotates, and alters colors of pictures.

Getting Started

Begin by downloading CS101_Assign8.zip. Save the zip file in the H:\CS101 directory.

Start the Cygwin Bash Shell and run the following commands:

cd h:
cd CS101
unzip CS101_Assign8.zip
cd CS101_Assign8

Leave the Cygwin Bash Shell open.

Start Visual Studio 2008 (from the Start menu, Programming->All Programs->Visual Studio 2008. Choose File->Open->Project/Solution.... Choose the file

H:\CS101\CS101_Assign8\CS101_Assign8.sln

In the Solution Explorer, double click the file Form1.cs. You should the form in a tab called Form1.cs [Design].

Your Task

Create a program that:

  1. contains an embedded resource picture
  2. tiles the picture into four pictureboxes, sizing the pictures so the width equals the width of the pictureboxes and the aspect ratio stays the same as the original
  3. redraws the pictures after the form is minimized
  4. allows the user to rotate and flip the pictures, keeping them tiled. You can decide exactly which pictures to rotate and flip and how much rotation and flipation to apply.
  5. recolors the pictures in three different ways. The original should be left in one picturebox, but the other three should be altered by switching the red, green, and blue components of each pixel.
  6. allows the user to bring in other pictures
  7. allows the user to save any one of the four pictures

Here is a screenshot:

figures/assign8.jpg

Hint

Objects in C# are actually pointers. Therefore, if you have two Bitmap objects, pic1 and pic2, and you execute this line:

pic2 = pic1;

then the memory addresses are the same and if you change pic2, pic1 changes. If you want them to be separate Bitmaps that act independently, create them separately. For example:

pic1 = new Bitmap(Image.FromStream(s));
pic2 = new Bitmap(Image.FromStream(s));

Grading Criteria

For up to 60% credit, display the tiled pictures scaled to the width of the picture boxes, keeping the aspect ratio the same as the original. This may crop the picture. The picture should come from an embedded resource and should reappear after the form has been minimized and restored.

For up to 70% credit, allow the user to bring in other pictures.

For up to 80% credit, change the colors of three of the pictures by switching the red, green, and blue components of each pixel.

For up to 90% credit, rotate and flip some or all of the pictures

For up to 100% credit, allow users to save any one of the pictures

For up to 150% credit, add other image processing effects such as darkening/lightening or contrast

Submitting

Important:

If your submission fails because it is too large (because of the embedded image), please follow the email submission instructions.

Before you submit, make sure Visual Studio is closed.

To submit, run the following command from the Cygwin bash shell (making sure that you are in the H:\CS101\CS101_Assign8 folder):

make submit

You will be prompted for your Marmoset username and password, which you should have received by email. Note that your password will not appear on the screen. Important: Make sure that you check the file(s) you submitted to ensure that they are correct. Log into the server using the following URL:

https://camel.ycp.edu:8443/view/course.jsp?coursePK=61

You should see a list of labs and assignments. In the row for assign8, click the link labeled view. You will see a list of your submissions. Download the most recent one (which should be listed first). Verify that it contains the correct files.

You are responsible for making sure that your submission contains the correct file(s).