Animated Buttons

AniButton.jpg

This class is a simple owner-draw CButton class that allows you to play animation files (AVI's) within the button. This class can be used like any other owner drawn control - simply include the header file, and declare your button controls as CAniButton instead of CButton

The class has the following methods:

BOOL Open( LPCTSTR lpszFileName );    // Open an AVI file using its filename
BOOL Open( UINT nID );              // Open an AVI file using its resource ID
void Play();                        // Start playing the animation 
void Stop();                        // Stop the animation
void Close();                       // Close the animation and free resources

To setup the button to play an animation, first add an AVI to your resources by editing the .rc file by hand and adding the following:

IDR_AVI1  AVI     DISCARDABLE     "res\\Animation.avi"

where Animation.avi is an AVI file in your /res directory (remember to define IDR_AVI1 in your resource.h file). Then, after creating the control (or in your dialogs OnInitDialog function, add the following

m_Button.Open(IDR_AVI1);
m_Button.Play();
where m_Button is your animation button.

License

转载于:https://www.cnblogs.com/junzhongxu/archive/2008/08/11/1264893.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值