|Bitmaps to videos|
|Written by Harry Fairhead|
|Tuesday, 21 July 2009|
Page 5 of 5
With the class fully defined we can now use it to create a video. Add a button to the form and in its click event handler write:
BmpToAVI movie=new BmpToAVI(this.Handle);
Prepare 10 bitmaps called 1.bmp, 2.bmp .. to 10.bmp containing the digits 0 to 9. These should be 24-bit uncompressed .BMP format files – you can use Paint to create them. Compressed .BMP files don’t work with VfW unless you explicitly uncompress them first. Palette 256 colour bitmaps also don’t seem to work but they don’t generate an error message.
The raw material
You also need to be aware that some graphics programs don’t write all of the fields in the bitmap headers and this can cause problems. None of the example code has any error checking included so that you can see more clearly how it all works. Using this and your first generated video you should be able to use the rest of the VfW API to do things like extract frames, recompress video data, add sound tracks and so on.
The test video in action
|Last Updated ( Tuesday, 21 July 2009 )|