예제 #1
0
        private void btnExtractPart_Click(object sender, EventArgs e)
        {
            AviManager aviManager = new AviManager(txtAviFileName.Text, true);
            VideoStream aviStream = aviManager.GetVideoStream();

            CopyForm dialog = new CopyForm(0, (int)Math.Floor(aviStream.CountFrames / aviStream.FrameRate));
            if (dialog.ShowDialog() == DialogResult.OK) {
                int startSecond = dialog.Start;
                int stopSecond = dialog.Stop;

                txtReportCopy.Text = "Cutting seconds from " + txtAviFileName.Text + " to video.avi...\r\n";
                AviManager newFile = aviManager.CopyTo("..\\..\\testdata\\video.avi", startSecond, stopSecond);
                newFile.Close();
                txtReportCopy.Text += "...finished.";
            }
            aviManager.Close();
        }
        private void saveWithVoiceStart_Click(object sender, EventArgs e)
        {
            AviManager aviManager = new AviManager(fileNameText.Text, true);
            VideoStream aviStream = aviManager.GetVideoStream();

            CopyForm dialog = new CopyForm(0, (int)Math.Floor(aviStream.CountFrames / aviStream.FrameRate));
            if (dialog.ShowDialog() == DialogResult.OK) {
                int startSecond = dialog.Start;
                int stopSecond = dialog.Stop;
                SaveFileDialog saveWithVoice = new SaveFileDialog();
                if (saveWithVoice.ShowDialog() == DialogResult.OK)
                {
                    noticeText.Text = fileNameText.Text+ " dosyasinin " + saveWithVoice.FileName.ToString() +" dosyasina d�n�s�m� basladi\r\n";
                    AviManager newFile = aviManager.CopyTo(saveWithVoice.FileName.ToString()+".avi", startSecond, stopSecond);
                    newFile.Close();
                    noticeText.Text += "...finished.";
                }
            }
            aviManager.Close();
        }