コード例 #1
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();
        }
コード例 #2
0
 /// <summary>
 /// Release the image and client objects.
 /// </summary>
 private void ReleaseObjects()
 {
     lock (_loadCompleteCallback)
     {
         if (_timer != null)
         {
             _timer.Stop();
             _timer.Dispose();
             _timer = null;
         }
         if (_releaseImageObject && _image != null)
         {
             _image.Dispose();
             _image = null;
         }
         if (_imageFileStream != null)
         {
             _imageFileStream.Dispose();
             _imageFileStream = null;
         }
     }
 }