Smooth Animation Algorithm in GUI Programming using PictureBox Control - Prof. Frank Mccow, Assignments of Computer Science

An assignment for creating a smooth animation program using a custom double-buffering algorithm in c# gui programming. Students are required to modify the happyanimation project and implement a private workspace bitmap object to enable the algorithm. The program should be submitted for grading as smooth.exe.

Typology: Assignments

Pre 2010

Uploaded on 08/18/2009

koofers-user-6o0-1
koofers-user-6o0-1 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Assignment 3 – Smooth Animation
GUI Programming
10 Points
A PictureBox control is ideal for displaying an image and for doing animation. The problem with the PictureBox
control is that if it is being used to animate a PNG or GIF image with a transparent background, it uses a double-
buffering algorithm that produces an undesirable effect. To overcome this limitation, we must implement our own
double-buffering algorithm.
Algorithm for Smooth Animation/Dragging:
1. Draw the initial Image bitmap onto the form.
2. Copy the background area of where Image is and will be into WorkSpace.
3. When the timer goes off, draw the Image at the new location onto WorkSpace and…
4. Draw WorkSpace onto the form so the Image appears at its new location.
5. Repeat 2-4 until the animation or dragging is completed.
Your assignment is to create a smooth animation program that implements this algorithm. The best way to create
this program is to modify the HappyAnimation program given to you in class. You will need to add a private
WorkSpace Bitmap object to your class so it is available to all the methods in your class.
The HappyAnimation project and smooth animation executable can be accessed from \\cs1\Classes\Comp445\C#\.
Submit your smooth.exe program to Easel before the next class period for grading.

Partial preview of the text

Download Smooth Animation Algorithm in GUI Programming using PictureBox Control - Prof. Frank Mccow and more Assignments Computer Science in PDF only on Docsity!

Assignment 3 – Smooth Animation GUI Programming 10 Points

A PictureBox control is ideal for displaying an image and for doing animation. The problem with the PictureBox control is that if it is being used to animate a PNG or GIF image with a transparent background, it uses a double- buffering algorithm that produces an undesirable effect. To overcome this limitation, we must implement our own double-buffering algorithm.

Algorithm for Smooth Animation/Dragging:

  1. Draw the initial Image bitmap onto the form.
  2. Copy the background area of where Image is and will be into WorkSpace.
  3. When the timer goes off, draw the Image at the new location onto WorkSpace and…
  4. Draw WorkSpace onto the form so the Image appears at its new location.
  5. Repeat 2-4 until the animation or dragging is completed.

Your assignment is to create a smooth animation program that implements this algorithm. The best way to create this program is to modify the HappyAnimation program given to you in class. You will need to add a private WorkSpace Bitmap object to your class so it is available to all the methods in your class.

The HappyAnimation project and smooth animation executable can be accessed from \cs1\Classes\Comp445\C#.

Submit your smooth.exe program to Easel before the next class period for grading.