Introduction
Many articles have discussed how to get a bitmap from an AVI file. So this article can only give the first concept to those have no idea of the AVI API, just as what I was a few weeks ago. This application adds some feathers; these include: adjusting the ratio of a bitmap to a certain value, such as a change from 16:9 to 4:3, adding a caption at the top of a bitmap etc.
Using the code
The function GetBitmap
is from Corinna John's article, you can read it for more details. To get the bitmap from an AVI file:
Bitmap bmp = AviBase.GetBitmap(txtFileName.Text, Convert.ToInt32(numPosition.Value));
here is how you adjust the format of the bitmap:
FormatBitmap f = new FormatBitmap();
f.m_nCaptionFontHeight = (int)numFontSize.Value;
f.m_nCaptionFontLeftSpace = (int)numLeftSpace.Value;
Bitmap bmp1 = f.GetFormattedBitmap(bmp, textCaption.Lines);