AVI - Animated button

You can see this effect on some multimedia programs: as you drag mouse over the button, the button will animate. The whole thing is in CAniButton class derived from CButton.

Use CAniButton as a normal CButton (Style must be Owner draw) On Init dialog simply use LoadAVI( AVI_ID ) where AVI_ID is ID of AVI file loaded in resources.

The button will resize to match the size of AVI animation. The first frame of animation will be used as a static look. Be careful when you create your own AVI file. Not everything could be played !

Here is what is written for Animated control in MSDN:

Animation controls can play only simple AVI clips. Specifically, the clips to be played by an animation control must meet the following requirements:
-There must be exactly one video stream and it must have at least one frame.
-There can be at most two streams in the file (typically the other stream, if present, is an audio stream, although the animation control ignores audio information).
-The clip must either be uncompressed or compressed with RLE8 compression.
-No palette changes are allowed in the video stream.

Download source 41KB



Comments

  • vc++

    Posted by Legacy on 03/18/2003 12:00am

    Originally posted by: jayashri

    how do we transmit avi files across the network?my project is in vc++ .images from a web camera are captured and stored as avi files. how to transmit them in a network?

    Reply
  • How Can I compress the Avi to RLE8 ?

    Posted by Legacy on 09/25/2002 12:00am

    Originally posted by: Chen Kopel

    How Can I compress the Avi to RLE8 ?
    Isn't it microsoft method ??
    Thanx

    Reply
  • How to fix problem with clicking

    Posted by Legacy on 01/30/2002 12:00am

    Originally posted by: Paweł Skrzyński

    As you probably noticed if you click this button you termiante the aplication. If you change this to sth. else for example: after you clicked you show MessageBox you can notice tha there is problem with this animation on the button.
    
    I fixed the problem in this way: add member function to CAniButton and name it for example StopAnimation():
    void CAniButton::stopAnimation()
    {
    m_AnimateCtrl.Stop(); //stop the animation
    m_AnimateCtrl.Seek(0);//set the first frame to be dispalyed on button
    m_bPlaying = FALSE;
    }

    after that in method that handles clicked message from button: CAvibtntestDlg::OnOk() before doing anything call
    m_ctrOK.stopAnimation():
    void CAvibtntestDlg::OnOk()
    {
    m_ctrOK.stopAnimation();
    //do sth.
    MessageBox("Test");
    }

    Reply
  • How to do it using SDK?

    Posted by Legacy on 11/03/2001 12:00am

    Originally posted by: Mudassar Iqbal

    I wish to know if there is any way to create animated buttons using SDK?

    Reply
  • How do i create the file of avibtntest.rc2 ?

    Posted by Legacy on 05/15/2001 12:00am

    Originally posted by: tcd

    I downded your example,but it didn't be used,because the
    file of avibtntest.rc2 isn't exst.

    Reply
  • This Class has class, but where can I get Avi files?

    Posted by Legacy on 05/26/2000 12:00am

    Originally posted by: Dan

    Love this class, but do you know where I can download some usefull avi files? I'm not into making them myself(Why reinvent the wheel?)
    Thanks,
    Dan

    Reply
  • I fount that it will not work after it was clicked.

    Posted by Legacy on 01/26/1999 12:00am

    Originally posted by: jingde

    It's very good,but i fount after i clicked it, it will not work anyother. Why?
    I have got a idea that add "m_YourBtn.SendMessage(WM_LBUTTONDOWN);" to the last of your Method of BN_CLICKED.


    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • With the average hard drive now averaging one terabyte in size, the fallout from the explosion of user-created data has become an overwhelming volume of potential evidence that law-enforcement and corporate investigators spend countless hours examining. Join Us and SANS' Rob Lee for our 45-minute webinar, A Triage and Collection Strategy for Time-Sensitive Investigations, will demonstrate how to: Identify the folders and files that often contain key insights Reduce the time spent sifting through content by …

Most Popular Programming Stories

More for Developers

RSS Feeds