コード例 #1
0
        private void btnWriteCompress_Click(object sender, System.EventArgs e)
        {
            FrameRateForm dlg = new FrameRateForm();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                //load the first image
                Bitmap bitmap = (Bitmap)Image.FromFile(txtFileNames.Lines[0]);
                //create a new AVI file
                AviManager aviManager = new AviManager(@"..\..\testdata\new.avi", false);
                //add a new video stream and one frame to the new file
                VideoStream aviStream = aviManager.AddVideoStream(true, dlg.Rate, bitmap);

                int count = 0;
                for (int n = 1; n < txtFileNames.Lines.Length; n++)
                {
                    if (txtFileNames.Lines[n].Trim().Length > 0)
                    {
                        bitmap = (Bitmap)Bitmap.FromFile(txtFileNames.Lines[n]);
                        aviStream.AddFrame(bitmap);
                        bitmap.Dispose();
                        count++;
                    }
                }

                aviManager.Close();
            }
        }
コード例 #2
0
        private void btnWrite_Click(object sender, System.EventArgs e)
        {
            FrameRateForm dlg = new FrameRateForm();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Bitmap      bmp        = (Bitmap)Image.FromFile(txtFileNames.Lines[0]);
                AviManager  aviManager = new AviManager(@"..\..\testdata\new.avi", false);
                VideoStream aviStream  = aviManager.AddVideoStream(false, dlg.Rate, bmp);

                Bitmap bitmap;
                int    count = 0;
                for (int n = 1; n < txtFileNames.Lines.Length; n++)
                {
                    if (txtFileNames.Lines[n].Trim().Length > 0)
                    {
                        bitmap = (Bitmap)Bitmap.FromFile(txtFileNames.Lines[n]);
                        aviStream.AddFrame(bitmap);
                        bitmap.Dispose();
                        count++;
                    }
                }

                aviManager.Close();
            }
        }
コード例 #3
0
        private void btnWrite_Click(object sender, System.EventArgs e)
        {
            FrameRateForm dlg = new FrameRateForm();
            if(dlg.ShowDialog() == DialogResult.OK){
                Bitmap bmp = (Bitmap)Image.FromFile(txtFileNames.Lines[0]);
                AviManager aviManager = new AviManager(@"..\..\testdata\new.avi", false);
                VideoStream aviStream = aviManager.AddVideoStream(false, dlg.Rate, bmp);

                Bitmap bitmap;
                int count = 0;
                for (int n = 1; n < txtFileNames.Lines.Length; n++) {
                    if (txtFileNames.Lines[n].Trim().Length > 0) {
                        bitmap = (Bitmap)Bitmap.FromFile(txtFileNames.Lines[n]);
                        aviStream.AddFrame(bitmap);
                        bitmap.Dispose();
                        count++;
                    }
                }

                aviManager.Close();
            }
        }
コード例 #4
0
        private void btnWriteCompress_Click(object sender, System.EventArgs e)
        {
            FrameRateForm dlg = new FrameRateForm();
            if(dlg.ShowDialog() == DialogResult.OK){
                //load the first image
                Bitmap bitmap = (Bitmap)Image.FromFile(txtFileNames.Lines[0]);
                //create a new AVI file
                AviManager aviManager = new AviManager(@"..\..\testdata\new.avi", false);
                //add a new video stream and one frame to the new file
                VideoStream aviStream = aviManager.AddVideoStream(true, dlg.Rate, bitmap);

                int count = 0;
                for (int n = 1; n < txtFileNames.Lines.Length; n++) {
                    if (txtFileNames.Lines[n].Trim().Length > 0) {
                        bitmap = (Bitmap)Bitmap.FromFile(txtFileNames.Lines[n]);
                        aviStream.AddFrame(bitmap);
                        bitmap.Dispose();
                        count++;
                    }
                }

                aviManager.Close();
            }
        }