How to render WPF animation frame by frame?

I created a nice effect that I like in WPF, I would like to β€œrecord” this effect. But at runtime, it is volatile.

Is there a way to convert it to frame by frame and save it as a video on my own, and not try to record it during playback?

Basically, I would like to visualize WPF as a video or list a series of frames saved as bitmap images.

The key thing is to be able to record animations with variability.

+4
source share
1 answer

Have you looked at using RenderTargetBitmap to render your Visual as a bitmap? You may need to play with moments of animation or connect to the OnRender event, but this will allow you to take control of you as an image.

To increase the animation sync bit: if you want to display your animation and save it as bitmap images (to then make a video), you could use Clock ClockController to manually configure the animation and display each frame in a file.

Another alternative is to set the values To , From and By to render each frame (for example, if the animation takes one second and you want to make 30 frames per second, you can change the animation for 30 seconds, advance for one second and display a bitmap image after each transition).

+1
source

All Articles