コード例 #1
0
        private void timer_Elapsed(object sender, EventArgs e)
        {
            _currentFrame++;
            if (_currentFrame >= _image.Frames.Count)
            {
                _currentFrame = 0;
            }
            _image.SetActiveFrame(_currentFrame);

            _timer.Interval = _image.Frames[_currentFrame].FrameDelay;
            _timer.Start();
            _htmlContainer.RequestRefresh(false);
        }
コード例 #2
0
        private void CreateAnimationTimer()
        {
            if (_timer != null)
            {
                return;
            }

            _currentFrame   = 0;
            _timer          = _htmlContainer.Adapter.CreateTimer();
            _timer.Interval = _image.Frames[_currentFrame].FrameDelay;
            _timer.Elapsed += timer_Elapsed;
            _timer.Start();
        }