How can I create animated marker windowsform

Topics: Windows Forms
Jan 4, 2011 at 8:07 AM


how can I create animated marker or

how can I create refresh() property add marker

I need animated marker please


Jan 4, 2011 at 3:28 PM, you can call in timer marker animation function and then MainMap.Invalidate(currentMarker.LocalArea); this should repaint your marker thus creating animation effect, i didn't test it myself, but that would be my start

Jan 4, 2011 at 8:15 PM
Edited Jan 4, 2011 at 8:31 PM

thank you radioman

must we  call onrender function in wich we had made the animation function ?

must be the animation function in the marker?

thanks for answers.

Jan 5, 2011 at 10:41 AM

See this code find in internet if can help.


The Code - An Animated GIF Class

Let's apply all of the concepts into one easy-to-use C# class:

public class GifImage
     private Image gifImage;
     private FrameDimension dimension;
     private int frameCount;
     private int currentFrame = -1;
     private bool reverse;
     private int step = 1;

public GifImage(string path) { gifImage = Image.FromFile(path); //initialize dimension = new FrameDimension(gifImage.FrameDimensionsList[0]); //gets the GUID frameCount = gifImage.GetFrameCount(dimension); //total frames in the animation }

public bool ReverseAtEnd //whether the gif should play backwards when it reaches the end { get { return reverse; } set { reverse = value; } }

public Image GetNextFrame() {
currentFrame += step;

//if the animation reaches a boundary... if (currentFrame >= frameCount || currentFrame < 1) { if (reverse) { step *= -1; //...reverse the count currentFrame += step; //apply it } else currentFrame = 0; //...or start over } return GetFrame(currentFrame); }

public Image GetFrame(int index) { gifImage.SelectActiveFrame(dimension, index); //find the frame return (Image)gifImage.Clone(); //return a copy of it } }
Jan 5, 2011 at 10:03 PM

thank for answer azar

Dec 26, 2013 at 7:34 AM
Edited Jan 2, 2014 at 7:21 AM
Hi,are you solved?I use above code as gif class,and put it in onrender of GMarker,when it run ,the marker is a static picture in map,why?thanks for answers.