I have written a bit of code that's supposed to create an avi file out of a List.
// instantiate AVI writer, use WMV3 codec
internal static AVIWriter writer = new AVIWriter( "wmv3" );
private static List<Bitmap> imgList = new List<Bitmap>();
internal static void SaveFile()
{
var list = imgList;
imgList = default(List<Bitmap>);
// create new AVI file and open it
writer.Open(@"d:\test.avi", 640, 480);
foreach (Bitmap b in list)
{
writer.AddFrame(b);
}
writer.Close();
}
Unfortubately, I am getting a nullreference exception at "foreach (Bitmap b in list)" But when I debug and place a breakpoint at writer.Close();, this error only triggers after I actually pass that breakpoint.
So I'm pretty confused, does anyone know what's going on here?