65.9K
CodeProject is changing. Read more.
Home

Get a bitmap from an AVI file

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.28/5 (13 votes)

May 3, 2006

CPOL
viewsIcon

62273

downloadIcon

2494

A simple idea about getting a bitmap from an AVI file.

Sample Image - Get_bitmap_from_AVI_file.jpg

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);