Example #1
0
 void MakeMainThumb(Thumbnail thumb)
 {
     _thumbGenerator.GetMainThumb(_filename, thumb, new ThumbsSettings());
 }
Example #2
0
        public void GetMainThumb(string filename, Thumbnail thumb, IThumbnailPropertiesProvider properties)
        {
            FFMpeg ffmpeg = new FFMpeg();

            thumb.Large = ffmpeg.TakeScreenshot(filename, thumb.Position, properties.LargeThumbSize);
        }
 public ThumbnailViewer(Thumbnail thumbnail)
     : this()
 {
     Thumbnail = thumbnail;
 }
 public ThumbnailViewer(Thumbnail thumbnail)
     : this()
 {
     Thumbnail = thumbnail;
 }
Example #5
0
        void tv_MouseDown(object sender, MouseEventArgs e)
        {
            var tv = sender as ThumbnailViewer;
            _selectedThumb = tv.Thumbnail;

            _tvClicked = true;
            _tvClickLocation = e.Location;
        }
Example #6
0
        private void UpdateThumbsPanel()
        {
            flThumbs.SuspendLayout();
            flThumbs.Controls.Clear();

            if (_thumbs == null)
                _thumbs = new List<Thumbnail>();

            if (_thumbs.Any() && _mainThumb==null)
            {
                MainThumb = _thumbs.OrderBy(t=>t.Position).First();
            }

            foreach (var thumb in _thumbs.OrderBy(t => t.Position))
            {
                ThumbnailViewer tv = new ThumbnailViewer(thumb);
                tv.Width = 180;
                tv.Height = 110;
                tv.CheckedChanged += new EventHandler(tv_CheckedChanged);
                tv.MouseDown += new MouseEventHandler(tv_MouseDown);
                tv.MouseMove += new MouseEventHandler(tv_MouseMove);
                tv.MouseUp += new MouseEventHandler(tv_MouseUp);
                tv.MouseDoubleClick += new MouseEventHandler(tv_MouseDoubleClick);
                flThumbs.Controls.Add(tv);
                tv.ContextMenuStrip = cmsThumbnail;

            }

            flThumbs.ResumeLayout();
            flThumbs.PerformLayout();
            tsmiUploadThumbnails.Enabled = _fileLoaded && _thumbs.Any(t => t.IsChecked);

            UpdateThumbsStatus();
        }
Example #7
0
 void tv_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     var tv = sender as ThumbnailViewer;
     _selectedThumb = tv.Thumbnail;
     PreviewThumb();
 }
Example #8
0
        private void tsmiMakeMain_Click(object sender, EventArgs e)
        {
            if (_selectedThumb == null)
            {
                return;
            }

            MainThumb = _selectedThumb;
        }
Example #9
0
 void MakeMainThumb(Thumbnail thumb)
 {
     _thumbGenerator.GetMainThumb(_filename, thumb, new ThumbsSettings());
 }
Example #10
0
        private void LoadFile(string filename)
        {
            if (_fileLoaded && _thumbs!=null && _thumbs.Any())
            {
                if (MessageBox.Show("При открытии нового файла все текущие скриншоты будут потеряны. Продолжить?", "Открытие файла", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes)
                {
                    return;
                };
            }

            _filename = filename;
            txtUploadName.Text = Path.GetFileName(_filename);
            txtUploadName.SelectAll();
            mplayer.URL = filename;
            _fileLoaded = true;

            _thumbs = null;
            _mainThumb = null;
            _newThumbs = null;

            cmbCategories.SelectedItem = null;

            UpdateReadyState();
        }
Example #11
0
        private void groupBox1_DragDrop(object sender, DragEventArgs e)
        {
            var thumb = e.Data.GetData(typeof(Thumbnail)) as Thumbnail;

            if(thumb!=null)
                MainThumb = thumb;
        }