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