Water Wave Effect of VC

Source: Internet
Author: User

: Http://files.cnblogs.com/rogee/WaveObject.rar

I always envy those with water waves.ProgramHowever, I am helpless. I couldn't write it by myself. It's hard to see a friend's program asking for the source code while having this special effect. Only then did I know that it was a control of Delphi, because I really couldn't get through to Delphi, so I'm sorry.

I suddenly remembered that I had seen such a compilation on Lao Luo's site.CodeTherefore, we have a "out of track" for it. Today I have referenced a lot of information on the Internet and finally compiled it into a lib and written a corresponding header file. Haha, in the future, my program will also have such special effects.

Here I will give the source ASM files I have rewritten, The RASM project files, the compiled lib and. H files, and hope you will like them.

The specific usage is as follows:
1. Load the library file first

 
# Include "./waveobject. H" # pragma comment (Lib, "./waveobject. lib ")

2. By viewing the original assembly code, we can know that this library needs to be initialized with _ waveinit. Then you can call the corresponding special effect function in the corresponding message function. Therefore, we declare two variables based on the _ waveinit () parameter.

Wave_object m_waveobject; hbitmap m_hbitmap;

The initialization code is as follows:

 
M_hbitmap = loadbitmap (getmodulehandle (null), makeintresource (idb_bitmap1); // The loaded image resource _ waveinit (& m_waveobject, getdlgitem (callback)-> getsafehwnd (), m_hbitmap, 2,180); // idc_static1 is the image control ID _ waveeffect (& m_waveobject,) of MFC. // you can use a special effect. For more information about the parameters, see the header file.

Add a response to the click Effect

 
Void upload: onlbuttondown (uint nflags, cpoint point) {clienttoscreen (& Point); getdlgitem (idc_static1)-> screentoclient (& Point); _ wavedropstone (& m_waveobject, point. x, point. y, 2,256); cdialog: onlbuttondown (nflags, point);}

Right-click the switch and try again.

The code for exiting the destroy object is as follows:

 void cbesunpackdlg: onclose () {_ wavefree (& m_waveobject); // release the water wave object cdialog :: onclose () ;}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.