Exemplo n.º 1
0
        public void Save(VlcPlayer player, BitmapSource source)
        {
            if (this.Name == null)
            {
                this.GetName(player);
            }

            BitmapEncoder encoder = null;

            switch (this.Format)
            {
            case SnapshotFormat.BMP:
                encoder = new BmpBitmapEncoder();
                break;

            case SnapshotFormat.JPG:
                encoder = new JpegBitmapEncoder()
                {
                    QualityLevel = this.Quality
                };
                break;

            case SnapshotFormat.PNG:
                encoder = new PngBitmapEncoder();
                break;
            }

            encoder.Frames.Add(BitmapFrame.Create(source));
            using (Stream stream = File.Create(String.Format("{0}\\{1}", this.Path, this.Name)))
            {
                encoder.Save(stream);
            }
        }
Exemplo n.º 2
0
 public String GetName(VlcPlayer player)
 {
     Name = String.Format("{0}-{1}-{2}",
                          GetMediaName(player.VlcMediaPlayer.Media.Mrl.Replace("file:///", "")),
                          (int)(player.Time.TotalMilliseconds), _count++);
     return(Name);
 }
Exemplo n.º 3
0
 private String GetName(VlcPlayer player)
 {
     Name = String.Format("{0}-{1}-{2}.{3}",
                          GetMediaName(player.VlcMediaPlayer.Media.Mrl.Replace("file:///", "")),
                          (int)(player.Time.TotalMilliseconds), _count++, Format.ToString().ToLower());
     return(Name);
 }
Exemplo n.º 4
0
        public void Save(VlcPlayer player, BitmapSource source)
        {
            if (Name == null)
            {
                GetName(player);
            }

            BitmapEncoder encoder = null;

            switch (Format)
            {
            case SnapshotFormat.BMP:
                encoder = new BmpBitmapEncoder();
                break;

            case SnapshotFormat.JPG:
                encoder = new JpegBitmapEncoder {
                    QualityLevel = Quality
                };
                break;

            case SnapshotFormat.PNG:
                encoder = new PngBitmapEncoder();
                break;
            }

            encoder.Frames.Add(BitmapFrame.Create(source));
            using (Stream stream = File.Create($"{Path}\\{Name}"))
            {
                encoder.Save(stream);
            }
        }
Exemplo n.º 5
0
 public String GetName(VlcPlayer player)
 {
     Name = String.Format("{0}-{1}-{2}",
         GetMediaName(player.VlcMediaPlayer.Media.Mrl.Replace("file:///", "")),
         (int)(player.Time.TotalMilliseconds), _count++);
     return Name;
 }
Exemplo n.º 6
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.vlcPlayer = ((Meta.Vlc.Wpf.VlcPlayer)(target));

            #line 33 "..\..\..\Pages\VLC_Page.xaml"
                this.vlcPlayer.Loaded += new System.Windows.RoutedEventHandler(this.Page_Loaded);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 7
0
 private string GetName(VlcPlayer player)
 {
     Name =
         $"{GetMediaName(player.VlcMediaPlayer.Media.Mrl.Replace("file:///", ""))}-{(int) player.Time.TotalMilliseconds}-{_count++}.{Format.ToString().ToLower()}";
     return(Name);
 }
Exemplo n.º 8
0
		/// <summary>
		/// Ctor.
		/// </summary>
		public MainViewModel()
		{
			SettingsViewModel = new SettingsViewModel();
			StatisticViewModel = new StatisticViewModel();

			if (SettingsViewModel.EnableStatisticTracking)
				StatisticViewModel.Startups++;

			_checkBoxFilter = "";
			_imagePathFilter = "";
			_imagePathList = new ObservableCollection<FileInfo>();
			_directoryList = new ObservableCollection<SenpaiDirectory>();
			IncludeFolderSubDirectories = true;
			DeleteImage = true;
			ResetCheckBoxes = true;
			LoadIgnoredPaths();
			LoadFavoritePaths();
			HotkeyPressedCommand = new KeyCommand(HotkeyPressed);
			TaskbarProgress = new TaskbarItemInfo() { ProgressState = TaskbarItemProgressState.Normal };
			VlcPlayer = new VlcPlayer() { EndBehavior = EndBehavior.Repeat };
			if (Environment.Is64BitProcess)
				VlcPlayer.LibVlcPath = @"..\..\..\Libs\Vlc\lib\x64-libs";
			else
				VlcPlayer.LibVlcPath = @"..\..\..\Libs\Vlc\lib\x86-libs";

			ReverseImageSearchButtonImage = "pack://application:,,,/SenpaiCopy;component/Resources/google-favicon.png";
			_reverseImageSearchWorker = new BackgroundWorker();
			_reverseImageSearchWorker.DoWork += new DoWorkEventHandler(GoogleReverseImageSearch);
			_dispatcher = Dispatcher.CurrentDispatcher;
		}