Exemplo n.º 1
0
        /// <summary>
        /// Uses the dotImaging library to compile a video from frames. Video should be an .avi to guarantee it working.
        /// </summary>
        /// <param name="imagePaths">Path to images to compile from.</param>
        /// <param name="videoPath">The path to the new video.</param>
        public void imagesToVideo(List <String> imagePaths, String videoPath)
        {
            Bitmap            im          = new Bitmap(imagePaths[0]);
            int               width       = im.Width;
            int               height      = im.Height;
            ImageStreamWriter videoWriter = new VideoWriter(videoPath, new DotImaging.Primitives2D.Size(width, height));

            foreach (String frame in imagePaths)
            {
                IImage image = ImageIO.LoadUnchanged(frame);
                videoWriter.Write(image);
                image.Dispose();
            }
            videoWriter.Close();
        }