Ejemplo n.º 1
0
        private void buttonConvert_Click(object sender, EventArgs e)
        {
            if (!swf.IsRunning)
            {
                swf.SWFConversionMode = SWFConversionModeType.SWFWithLiveData;
                swf.ConversionTimeOut = 15000;

                swf.InputSWFFileName = "test.swf";

                // you may calculate output video duration using information about the the source swf movie
                // WARNING #1: this method to calculate the output video duration is not working for movies with dynamic scenes
                // and interactive scripts as in these movies it is not possible to calculate the precise duration of the movie
                // WARNING #2: you should set the input swf or flv filename (or url) before this calculation

                // So the movie duration is calculated as the following:
                // as swf frame count (number of frames in the swf) / movieFPS (frames per second defined in swf)
                // and then multiplied by 1000 (as we are setting the .ConverstionTimeout in milliseconds)
                // as the following (uncomment if you want to set the length of the output video to the same as the original swf)
                // or as the following source code (uncomment to enable):

                // swf.ConversionTimeout = 1000 * (swf.FrameCount / swf.MovieFPS)

                swf.OutputVideoFileName = "test.wmv";
                swf.OutputWidth         = 640;
                swf.OutputHeight        = 480;

                swf.SetPreviewContext(m_hdc.ToInt32(), 0, 0, pictureBox1.Width, pictureBox1.Height, 30);
                swf.Run();
            }
        }
Ejemplo n.º 2
0
        private void buttonConvert_Click(object sender, EventArgs e)
        {
            if (!swf.IsRunning)
            {
                swf.SWFConversionMode = SWFConversionModeType.SWFAnimation;
                swf.ConversionTimeOut = 5000;

                swf.InputSWFFileName    = "test.swf";
                swf.OutputVideoFileName = "test.wmv";

                swf.SetProgressNotifyWindow(Handle.ToInt32(), WM_CONVERSION_PROGRESS, 0);

                swf.Run();
            }
        }