Quantcast
Channel: Splicer
Viewing all articles
Browse latest Browse all 19

New Post: Progress of Rendering

$
0
0
I found a solution to the above problem.

First of all, put all of the rendering code into a separate method in your object.

Then call it using tasks to spawn its own thread:
var runningTask = Task.Factory.StartNew(() => MakeMovie());

Next, have the ProgressChanged method simply update a variable that is global to the main class (or form)

Finally put a timer on the form that ticks every 100 milliseconds and updates the progressbar from the global variable.
   private void timerRendering_Tick(object sender, EventArgs e)  // called form timer
    {
        if (iProgressBarValue >= 100)
        {
            tRendering.Enabled = false;
            tRendering.Stop();
        }
        UpdateProgressBar();  // using the current iProgressBarValue
    }


   private void participant_ProgressChanged(object sender, Splicer.Renderer.ProgressChangedEventArgs e) //Callback called from spicer rendering code.
    {
            iProgressBarValue = (int)(e.Progress * 100) + 1;
    }


Viewing all articles
Browse latest Browse all 19

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>