back
Introduction to the Windows Graphic Device Interface (GDI) Part 2
Now that you know how to make an image move across the screen using the GDI, let's take it to the next level. Let's say you want an image to change as it moves. Before we just had one image moving across the screen, but now we want our image to do something as it moves. If we were animating a bird, we wouldn't just want a picture of a bird to slide across the screen, we would want it to flap its wings as it moved.

I am going to make an image of a star that changes size and color as it moves. First I start by filling the background of my image with black:



Next, I create my mask:



Then, I lay out my form:

Try running the sample program located in the public folder named "Animation2."

Assignment

  1. Read through this example on the web: Drawing and Animation Tutorial #2

    Just read the section that starts with Sprite Animations and StretchBlt up to the section StretchBlt
  2. Create your own graphic and modify the program to animate it.
  3. Do the More on Timing suggestions on the web page.