C# 클래스 AForge.Video.VFW.AVIWriter

AVI files writing using Video for Windows interface.

The class allows to write AVI files using Video for Windows API.

Sample usage:

// instantiate AVI writer, use WMV3 codec AVIWriter writer = new AVIWriter( "wmv3" ); // create new AVI file and open it writer.Open( "test.avi", 320, 240 ); // create frame image Bitmap image = new Bitmap( 320, 240 ); for ( int i = 0; i < 240; i++ ) { // update image image.SetPixel( i, i, Color.Red ); // add the image as a new frame of video file writer.AddFrame( image ); } writer.Close( );
상속: IDisposable
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

공개 메소드들

메소드 설명
AVIWriter ( ) : System

Initializes a new instance of the AVIWriter class.

Initializes Video for Windows library.

AVIWriter ( string codec ) : System

Initializes a new instance of the AVIWriter class.

Initializes Video for Windows library.

AddFrame ( Bitmap frameImage ) : void

Add new frame to the AVI file.

The method adds new video frame to an opened video file. The width and heights of the frame should be the same as it was specified in Open method (see Width and Height properties).

Close ( ) : void

Close video file.

Dispose ( ) : void

Dispose the object.

Frees unmanaged resources used by the object. The object becomes unusable after that.

Open ( string fileName, int width, int height ) : void

Create new AVI file and open it for writing.

The method opens (creates) a video files, configure video codec and prepares the stream for saving video frames with a help of AddFrame method.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Dispose the object.

메소드 상세

AVIWriter() 공개 메소드

Initializes a new instance of the AVIWriter class.
Initializes Video for Windows library.
public AVIWriter ( ) : System
리턴 System

AVIWriter() 공개 메소드

Initializes a new instance of the AVIWriter class.
Initializes Video for Windows library.
public AVIWriter ( string codec ) : System
codec string Codec to use for compression.
리턴 System

AddFrame() 공개 메소드

Add new frame to the AVI file.

The method adds new video frame to an opened video file. The width and heights of the frame should be the same as it was specified in Open method (see Width and Height properties).

Thrown if no video file was open. Bitmap size must be of the same as video size, which was specified on opening video file. A error occurred while writing new video frame. See exception message.
public AddFrame ( Bitmap frameImage ) : void
frameImage System.Drawing.Bitmap New frame image.
리턴 void

Close() 공개 메소드

Close video file.
public Close ( ) : void
리턴 void

Dispose() 공개 메소드

Dispose the object.
Frees unmanaged resources used by the object. The object becomes unusable after that.
public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Dispose the object.
protected Dispose ( bool disposing ) : void
disposing bool Indicates if disposing was initiated manually.
리턴 void

Open() 공개 메소드

Create new AVI file and open it for writing.

The method opens (creates) a video files, configure video codec and prepares the stream for saving video frames with a help of AddFrame method.

Failed opening the specified file. A error occurred while creating new video file. See exception message. Insufficient memory for internal buffer. Video file resolution must be a multiple of two.
public Open ( string fileName, int width, int height ) : void
fileName string AVI file name to create.
width int Video width.
height int Video height.
리턴 void