AVI RENDERING IN C#
Modified : June 22 2009

I racked my brains to come up with something interesting to write with Managed C++ that hadn't been done before. This is what I came up with - a .NET assembly that lets the developer create AVI movie files from any number of Bitmap instances. I used it to create a sample application that can build movies from any image type supported by the .NET Framework.

The API is intentionally very simple:

- Create an ImageSequenceCompressor instance
- Call beginSequence(), giving a sample Bitmap, filename and FPS value
- This will bring up the standard AVI Codec choice dialog
- Call addBitmap() with all the Bitmaps you want added to the AVI
- Call endSequence(), all done!

I ended up using the sample movie-maker application a great deal to build demo movies rendered from some game console hardware... saved having to fire up a larger, bulkier application to do it for me.

moviemaker

sure, it's ugly. but it's very useful!
It accepts a .NET String regular expression for
the file search, not just standard wildcards.

The source also shows how to use the Windows Multimedia AVI API, AVIFileOpen, AVIFileCreateStream, AVISaveOptions, etc. It also demonstrates some Managed C++ code for working with strings and Bitmaps from MC++ code, Marshal::StringToHGlobalAnsi, GetHbitmap().ToPointer(), etc


Get the source code to the DLL here.
Get the source to the sample movie making application here. Built with .NET 1.1 and VS 2003.