Exemplo n.º 1
0
        private void startToConvert_Click(object sender, EventArgs e)
        {
            AviManager  aviManager = new AviManager(fileNameText.Text, true);
            VideoStream stream     = aviManager.GetVideoStream();

            stream.GetFrameOpen();
            fileName = fileNameText.Text;
            int length = fileName.Length, j;

            for (j = length - 1; j > 0; j--)
            {
                if (fileName[j] != '\\')
                {
                    newfileName += fileName[j];
                }
                else
                {
                    break;
                }
            }
            fileName = "";
            for (j = newfileName.Length - 1; j >= 0; j--)
            {
                fileName += newfileName[j];
            }
            fileName = fileName.ToLower();
            j        = 0;
            path     = "";
            for (j = 0; j < fileNameText.Text.Length - fileName.Length; j++)
            {
                path += fileNameText.Text[j];
            }
            int    startFrame = Convert.ToInt32(startPointTrackerText.Text);
            int    endFrame   = Convert.ToInt32(endPointTrackerText.Text);
            string bmpname    = "";
            int    ali        = 0;

            for (int n = startFrame; n < endFrame; n++)
            {
                bmpname = ali.ToString();
                stream.ExportBitmap(n, "c:/temp/" + bmpname + ".bmp");
                pathBox.Items.Add("c:/temp/" + bmpname + ".bmp");
                ali++;
                startPointTracker.Value = n;
                textBox3.Text           = n.ToString();
            }
            stream.GetFrameClose();
            aviManager.Close();
            makeAvi();
        }
Exemplo n.º 2
0
        private void btnExtract_Click(object sender, System.EventArgs e)
        {
            AviManager aviManager = new AviManager(txtAviFileName.Text, true);

            VideoStream stream = aviManager.GetVideoStream();

            stream.GetFrameOpen();

            txtReportCopy.Text = txtFileNames.Text = String.Empty;
            String path = @"..\..\testdata\";

            for (int n = 0; n < stream.CountFrames; n++)
            {
                stream.ExportBitmap(n, path + n.ToString() + ".bmp");
                txtReportCopy.Text += n + ".bmp finished...\r\n";
                txtFileNames.Text  += path + n + ".bmp\r\n";
            }

            stream.GetFrameClose();
            aviManager.Close();
        }