Ejemplo n.º 1
0
        void ProcessImage(Image image, Time duration)
        {
            string path = System.IO.Path.GetTempFileName().Replace(@"\", @"\\");

            image.Save(path);
            videoEditor.AddImageSegment(path, 0, duration.MSeconds, "", new Area());
        }
Ejemplo n.º 2
0
        private bool ProcessSegment(PlayListPlay segment)
        {
            if (!segment.Valid)
            {
                return(false);
            }

            Log.Debug(String.Format("Adding segment with {0} drawings", segment.Drawings.Count));
            if (segment.Drawings.Count >= 1)
            {
                Drawing drawing    = segment.Drawings[0];
                string  image_path = CreateStillImage(segment.MediaFile.FilePath, drawing);

                videoEditor.AddSegment(segment.MediaFile.FilePath,
                                       segment.Start.MSeconds,
                                       drawing.RenderTime - segment.Start.MSeconds,
                                       segment.Rate,
                                       segment.Name,
                                       segment.MediaFile.HasAudio);
                videoEditor.AddImageSegment(image_path,
                                            drawing.RenderTime,
                                            drawing.PauseTime,
                                            segment.Name);
                videoEditor.AddSegment(segment.MediaFile.FilePath,
                                       drawing.RenderTime,
                                       segment.Stop.MSeconds - drawing.RenderTime,
                                       segment.Rate,
                                       segment.Name,
                                       segment.MediaFile.HasAudio);
            }
            else
            {
                videoEditor.AddSegment(segment.MediaFile.FilePath,
                                       segment.Start.MSeconds,
                                       segment.Duration.MSeconds,
                                       segment.Rate,
                                       segment.Name,
                                       segment.MediaFile.HasAudio);
            }
            return(true);
        }