/// <summary> /// Load a gesture asyncronously /// </summary> /// <param name="FileName"></param> /// <returns></returns> public async Task LoadGestureAsync(string FileName) { try { loadedGesture = new Gesture(); await loadedGesture.LoadFileAsync(FileName); loadedGesture.ImageSource = imageSource; if (AnimateAllFrames) { animationFrames = loadedGesture.StaticFrames(); } else { animationFrames = loadedGesture.FramesToMatch(); } SetAnimationIndex(0); } catch (Exception) { CloseGesture(); throw; } }
/// <summary> /// Load a gesture into the viewer /// </summary> /// <param name="FileName"></param> public void LoadGesture(string FileName) { try { var gestures = new List <Gesture>(); loadedGesture = new Gesture(FileName); loadedGesture.ImageSource = imageSource; if (AnimateAllFrames) { animationFrames = loadedGesture.StaticFrames(); } else { animationFrames = loadedGesture.FramesToMatch(); } SetAnimationIndex(0); gestures.Add(loadedGesture); drawBodyFromFrame(loadedGesture.Frames[0]); } catch (Exception ex) { CloseGesture(); throw (ex); } }
/// <summary> /// Start playing the animation /// </summary> public void StartAnimation() { if (loadedGesture == null) { return; } if (animateAllFrames) { animationFrames = loadedGesture.StaticFrames(); } else { animationFrames = loadedGesture.FramesToMatch(); } SetAnimationIndex(0); animationTimer.Start(); }