1.11.4 Exporting VideosVideo Writer
Version Info
Minimum Origin Version Required: Origin 9 SR0
Origin allows user to create a video with a collection of graphs. Origin C allows access to this ability using the Video Writer, you can define the video codec for compression (Please refer to FourCC Table for more details.), create a video writer project specifying the video name, path, speed and dimension, write graph pages as frames.
Note: To use the video writer, you must include its head file:
#include <..\OriginLab\VideoWriter.h>
The following example will write each graph in the project as a frame into the video, and the video is uncompressed with 2 frames/second speed and 800px * 600 px dimension.
// Use the raw format without compression.
int codec = CV_FOURCC(0,0,0,0);
// Create a VideoWriter object.
VideoWriter vw;
int err = vw.Create("D:\\example.avi", codec, 2, 800, 600);
if (0 == err)
{
foreach(GraphPage grPg in Project.GraphPages)
// write the graph page into the video
err = vw.WriteFrame(grPg);
}
// Release the video object when finished.
vw.Release();
return err;
The following example shows how to individually write a graph page into video and define the number of frames of this graph page in the video.
GraphPage gp("Graph1");
// The defined graph page will last for 10 frames.
int nNumFrames = 10;
vw.WriteFrame(gp, nNumFrames);
|