Click here to Skip to main content
15,867,686 members
Articles / Desktop Programming / MFC
Article

CAnimateCtrl Example

Rate me:
Please Sign up or sign in to vote.
3.88/5 (7 votes)
15 Dec 1999 162.5K   2.4K   25   26
Demonstrates the use of the windows animation control
  • Download demo project - 144 Kb
  • Sample Image - controls_avi.gif

    Its pretty easy to implement an avi control. Follow these steps to add an avi animation control (CAnimateCtrl) to your dialog resource:

    • In the resource editor, click on the animate control icon, and place one on your dialog.
    • Go into 'Class Wizard' and add a control name to your newly inserted component. example:
      CAnimateCtrl m_avi;this is placed in your .h file.
    • Next, import the .avi file into your project. To do this, highlite your resource project name, and right click in the resource view window. Select import. Set the filter to *.avi, and select the avi file you want to import.
    • Enter "AVI" for resource type in the custom resource type dialog box.
    • Add the following code to your project:
      /////////////////////////////////////////////////////////////////////////////
      // CAvidemoDlg message handlers
      
      BOOL CAvidemoDlg::OnInitDialog()
      {
      	CDialog::OnInitDialog();
      	...
      	...
      	
      	// TODO: Add extra initialization here
      	m_avi.Open( IDR_AVI ); // open the avi resource.
      	m_avi.Play( 0, -1,-1 );play avi resource.
      	
      	// return TRUE unless you set the focus to a control
      	return TRUE;
      }

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here


    Written By
    CEO Codejock Technologies, LLC
    United States United States
    This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
    This is a Organisation (No members)


    Comments and Discussions

     
    Questionhow about it in c#??? Pin
    jabulino9-Jan-06 0:23
    jabulino9-Jan-06 0:23 
    GeneralResum avi Pin
    Member 185845015-Dec-05 18:01
    Member 185845015-Dec-05 18:01 
    GeneralOne 1 MB Avi file doesn't shows Pin
    anderslundsgard26-Sep-05 10:21
    anderslundsgard26-Sep-05 10:21 
    Questionhow to create an appropriate AVI Pin
    mohsen nourian2-Jul-05 20:44
    mohsen nourian2-Jul-05 20:44 
    AnswerRe: how to create an appropriate AVI Pin
    .dan.g.2-Jul-05 21:20
    professional.dan.g.2-Jul-05 21:20 
    GeneralRe: how to create an appropriate AVI Pin
    meistertausend2-Nov-05 1:55
    meistertausend2-Nov-05 1:55 
    QuestionHow to access pixel values in an avi stream? Pin
    JDeimos25-Jan-05 1:22
    JDeimos25-Jan-05 1:22 
    GeneralWhere to find AVI-Files Pin
    nurfuerschrott9-Aug-04 1:48
    nurfuerschrott9-Aug-04 1:48 
    GeneralCAnimateCtrl upgradation Pin
    quantum198119-Jun-04 21:25
    quantum198119-Jun-04 21:25 
    GeneralResource type must be called "AVI" or it will not work Pin
    Member 9613-Dec-02 12:17
    Member 9613-Dec-02 12:17 
    GeneralStretch Avi Pin
    10-May-02 4:40
    suss10-May-02 4:40 
    GeneralLoad avi from lets say C:\test.avi Pin
    Keybee3-Feb-02 2:36
    Keybee3-Feb-02 2:36 
    GeneralRe: Load avi from lets say C:\test.avi Pin
    Synetech18-Feb-03 8:43
    Synetech18-Feb-03 8:43 
    Generalgetting rid of avi Pin
    15-Oct-01 12:18
    suss15-Oct-01 12:18 
    GeneralRe: getting rid of avi Pin
    3-Apr-02 8:54
    suss3-Apr-02 8:54 
    GeneralNEED HELPON AVI!!! Pin
    24-May-01 14:30
    suss24-May-01 14:30 
    GeneralRe: NEED HELPON AVI!!! Pin
    Earl Rex Arao-arao30-May-01 20:41
    Earl Rex Arao-arao30-May-01 20:41 
    GeneralNEED HELPON AVI!!! Pin
    24-May-01 14:30
    suss24-May-01 14:30 
    GeneralTransparent Pin
    11-May-01 10:22
    suss11-May-01 10:22 
    GeneralCompressed AVI Pin
    Meraviglia, Dario13-Jul-00 21:37
    sussMeraviglia, Dario13-Jul-00 21:37 
    GeneralRe: Compressed AVI Pin
    22-Jul-01 7:41
    suss22-Jul-01 7:41 
    GeneralRe: Compressed AVI Pin
    22-Jul-01 7:43
    suss22-Jul-01 7:43 
    Like described in the MSDN, CAnimateCtrl only supports uncompressed AVI and AVIs compressed using Microsoft RLE8. You can create these AVIs with the program "Videdit" that comes with "Video for Windows" from Microsoft.

    Ruhrfire
    GeneralAVI file Pin
    Tony Li17-Mar-00 11:27
    Tony Li17-Mar-00 11:27 
    GeneralAVI file Pin
    Tony Li17-Mar-00 11:27
    Tony Li17-Mar-00 11:27 
    GeneralRe: AVI file Pin
    4-Nov-00 17:45
    suss4-Nov-00 17:45 

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

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