Example #1
0
 private void InitClass( )
 {
     _viewer               = new RasterPictureBox();
     _viewer.Dock          = DockStyle.Fill;
     _viewer.BorderStyle   = BorderStyle.None;
     _viewer.FrameChanged += new EventHandler <RasterPictureBoxFrameChangedEventArgs>(_viewer_FrameChanged);
     Controls.Add(_viewer);
     _viewer.BringToFront();
 }
Example #2
0
        private void SetTheImage(string str, bool isUrl)
        {
            _isGif = str.ToLower().EndsWith("gif");

            FeedLoadDialog dlg;

            if (isUrl)
            {
                dlg = new FeedLoadDialog(_codecs, str, null);
            }
            else
            {
                dlg = new FeedLoadDialog(_codecs, null, str);
            }
            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                if (_isGif == true)
                {
                    _pictureBox.Image = dlg.Image;
                    for (int x = 1; x <= _pictureBox.Image.PageCount; x++)
                    {
                        _pictureBox.Image.Page = x;
                        if (_pictureBox.Image.AnimationDelay == 0)
                        {
                            _pictureBox.Image.AnimationDelay = 100;
                        }
                    }
                    dlg.Image.Page = 1;
                    _pictureBox.BringToFront();
                    _pictureBox.Visible = true;
                    _pictureBox.PlayAnimation();
                }
                else
                {
                    _viewer.Image = dlg.Image;
                    _viewer.BringToFront();
                }
                UpdateButtons();
            }
        }