2.2.7.13.5 VideoWriter::WriteFrame

Version Info

Minimum Origin Version Required: Origin 9 SR0

Description

Constructor.

Syntax

int WriteFrame( const IplImage * iplimg, UINT nNumFrames = 1 )


int WriteFrame( const CvMat & cvmat, UINT nNumFrames = 1 )


int WriteFrame( HDIB hDib, UINT nNumFrames = 1 )


int WriteFrame( const MatrixObject & mo, UINT nNumFrames = 1 )


int WriteFrame( const MatrixLayer & ml, int nObj = -1, UINT nNumFrames = 1 )


int WriteFrame( const GraphPage & gp, UINT nNumFrames = 1 )

Parameters

iplimg
[Input] The image being written to the video.
nNumFrames
[Input] The number of frames.


cvmat
[Input] The image matrix being written to the video.
nNumFrames
[Input] The number of frames.


hDib
[Input] Handle to a Device Independent Bitmap.
nNumFrames
[Input] The number of frames.


mo
[Input] The matrix object being written into the video.
nNumFrames
[Input] The number of frames


ml
[Input] The matrix layer being written into the video.
nObj
[Input] The number of the selected matrix object. -1 for active matrix object.
nNumFrames
[Input] The number of frames.


gp
[Input] The graph page being written to the video.
nNumFrames
[Input] The number of frames.

Return

0: Success

none 0 values: Error code


0: Success

none 0 values: Error code


0: Success

none 0 values: Error code


0: Success

none 0 values: Error code


0: Success

none 0 values: Error code


0: Success

none 0 values: Error code

Examples

EX1

#include <..\OriginLab\VideoWriter.h>
void VideoWrite_WriteFrame_ex1()
{
	// 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)
			err = vw.WriteFrame(grPg);//write the graph page into the video
	}
    vw.Release();// Release the video object when finished.
}

EX2

#include <..\OriginLab\VideoWriter.h>
void VideoWrite_Release_ex2()
{
	// 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)
	{
		GraphPage gp("Graph1");
		int nNumFrames = 10;//The defined graph page will last for 10 frames.
		vw.WriteFrame(gp, nNumFrames);
	}

    vw.Release();// Release the video object when finished.
}

Remark

See Also

WriteFrames

Header to Included

VideoWriter.h