void MakeMainThumb(Thumbnail thumb) { _thumbGenerator.GetMainThumb(_filename, thumb, new ThumbsSettings()); }
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; }
void tv_MouseDown(object sender, MouseEventArgs e) { var tv = sender as ThumbnailViewer; _selectedThumb = tv.Thumbnail; _tvClicked = true; _tvClickLocation = e.Location; }
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(); }
void tv_MouseDoubleClick(object sender, MouseEventArgs e) { var tv = sender as ThumbnailViewer; _selectedThumb = tv.Thumbnail; PreviewThumb(); }
private void tsmiMakeMain_Click(object sender, EventArgs e) { if (_selectedThumb == null) { return; } MainThumb = _selectedThumb; }
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(); }
private void groupBox1_DragDrop(object sender, DragEventArgs e) { var thumb = e.Data.GetData(typeof(Thumbnail)) as Thumbnail; if(thumb!=null) MainThumb = thumb; }