Mr Jancic, I do not quite understand what you mean by 'move changing
the picture co-ordinates'. Are you suggesting to move something (and
what is it?) by change the picture's co-ordinates or simply to move
something by changing the picture's co-ordinates? And how would I do
what you're suggesting with a timer?
There are no sprites in .NET. You animate the motion of some image by
drawing it repeatedly at different coordinates.
For example, if you want to move something in a horizontal line from (0,0)
to (100,0), you set your x coordinate to 0, draw the image, and then
repeatedly add some constant to the x coordinate until it's gotten to 100,
redrawing the image each time you update the x coordinate.
As you say, if you simply do this in a loop without any sort of logic to
deal with the speed, the time it takes to get from (0,0) to (100,0) will
depend on the speed of the computer. So you need to incorporate some sort
of timer into the logic.
One way is to do what Diego suggests: figure out what the interval between
each iteration should be, and use a timer to alert you each time that
interval is up. Every time you get notification of the timer, you would
update the coordinates and redraw your image.
This method requires that you select a distance the image will move with
each iteration, as well as a total time to take to accomplish the
movement. You then calculate the timer interval based on those numbers
(interval = (total time) / (total distance / iteration distance)).
An alternative method starts with the timer interval and calculates the
distance the image needs to move each iteration. You would still use a
timer, but instead you calculate the iteration distance (iteration
distance = (total distance) / (total time / interval)).
Of course, since in a real situation you would likely have to change both
the x and y coordinates, you need to calculate the change for both
coordinates based on the distance moved.
There are other methods to control the speed of an animated image, but the
above is probably the most straightforward way to do it in .NET.
Pete