Click here to Skip to main content
Licence CPOL
First Posted 2 May 2006
Views 34,481
Downloads 617
Bookmarked 18 times

Get a bitmap from an AVI file

By | 2 May 2006 | Article
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);

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Denny50

Software Developer (Senior)

Australia Australia

Member

Senior software engineer with 10 years experience of C/C++ programming. Now also has some project with C#. I'm from Shanghai and now working at Melbourne. At I spare time, I enjoy my family life. My blog, Childhood is a collection about my family, epically my lovely son. Most of them write in Chinese, and a few in my poor English - please forgive me, I'm improving my English as soon as I can.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionGetBitmap returns empty bitmap PinmemberTHEAniKan14:45 30 Apr '10  
GeneralExport Image problem PinmemberTarang Deshpande7:33 13 Oct '09  
Generalbitmap is shifted with round robin fashion for an AVI file. Pinmemberprakash Invent2:25 24 Feb '09  
GeneralSome speed improvements PinmemberGeorgi Petrov4:00 23 Jun '06  
GeneralAVI file frame count PinmemberGeorgi Petrov13:16 15 Jun '06  
GeneralRe: AVI file frame count PinmemberDenny Wang14:31 15 Jun '06  
GeneralRe: AVI file frame count PinmemberGeorgi Petrov21:22 15 Jun '06  
GeneralRe: AVI file frame count Pinmemberelectriac5:21 29 May '10  
Generalproblem with long files Pinmemberludwig boltzmann3:13 17 May '06  
GeneralRe: problem with long files Pinmemberludwig boltzmann21:43 29 May '06  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 3 May 2006
Article Copyright 2006 by Denny50
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid