tags:

views:

123

answers:

1

I need to "animate" an arrow. It can go in any direction (up, down, left, right and diagonals) and the arrowhead will be at the end. It needs to appear as if it is growing from orgin to the end. To make matters more complicated it has to be in a user control so it is possible to add to the controls collection in the forms and remove it to delete it from the screen, and its background is really transparent (no color.transparent) so i can't paint the background to "clear" the previous line. I have it static already (drawn from origin to end) but i can't animate it. I tried to add a timer in the user control but I fail to get a correct algorithm to calculate the intermediate ends of the line while it is growing. Any help would be appreciated. Thanks

A: 

When using animation on a Windows form you have to use another thread. Look into using a background worker: http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx

Icono123
If you don't want to use a background worker I think you could use a picture box and then swap out the image. I personally would use the background worker.
Icono123
my problem was how to "animate" the line not where to make it happen. I mean, i was planning to do it in separate thread, but i could not find a way to make the line appear as growing. I found a way now, which is drawing point by point.thanks
Fer