Aquarium Screen Saver

make aquarium screen saver in C#

Page 1 of 1

1 Replies - 4063 Views - Last Post: 15 November 2010 - 03:16 PM Rate Topic: -----

#1 Guest_computergirl*


Aquarium Screen Saver

Posted 15 November 2010 - 02:30 PM

I am making a screen saver that has aquarium affects. For example, fish,marbles, bubbles,etc. I need help on a C# command to get the fish to move in a horizontal or vertical way across the screen. Or an example line of code to get any image or picture to move. I am using Sharp Developer. Please help, thanks!
Is This A Good Question/Topic? 0

Replies To: Aquarium Screen Saver

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 5187
  • View blog
  • Posts: 13,917
  • Joined: 18-April 07

Re: Aquarium Screen Saver

Posted 15 November 2010 - 03:16 PM

Remember that animation is just like cartoons... draw, move a little, draw again, move a little and draw yet again. It is no different in C#. You draw your fish in one spot on the form, move it a little and repaint the form. So what you need first is to know how to draw an image on the form. Once you have done that, you are half way there. You can change the image, move it a little (move its x coordinate to go back and forth) and draw it again.

To get you started with drawing in C# you can check out the following site...

Drawing Graphics in C# - Techotopia

Once you get the basics of drawing down, check out classes like Bitmap and Image classes for accessing images on your computer and then using a Graphics Object you can call one of many DrawImage functions. Many of them are outlined at MSDN for you to check out.

Graphics Class (System.Drawing) - MSDN

Each DrawImage method has varying parameters that can help you take an image and draw it at various locations etc. You can get access to a Graphics Object for a form or panel etc through its Paint event. So check out the paint event and in there you will write all your drawing code.

Enjoy! :)

This post has been edited by Martyr2: 15 November 2010 - 03:19 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1