I have a WPF storyboard that I want to step through frame-by-frame (for a variable framerate). At each frame my intention is to story a bitmap of the drawn storyboard state. To this end I am trying to employ the following method:
this.CurrentStoryboard.Begin(this);
this.CurrentStoryboard.Pause(this);
//call a function (SEEKFUNC) which calls the following method for (increasing "frameNumber"s):
this.CurrentStoryboard.Seek(this, TimeSpan.FromSeconds(((double)frameNumber) / c_FrameRate), TimeSeekOrigin.BeginTime);
//wait for drawing to complete at point
SaveFrame(this.saveCanvas);
//call SEEKFUNC with frameNumber++
What I am struggling with however is finding out when the Storyboard has completed and been rendered. Can I assume that this will have been successfully completed by the second subsequent call to CompositionTarget.Rendering? Is there another, neater way?