예제 #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);
            }
        }
예제 #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);
 }
예제 #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);
 }
예제 #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);
            }
        }
예제 #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;
 }
예제 #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;
        }
예제 #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);
 }
예제 #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;
		}