资源简介
涟漪 水纹 ,在图片中点击产生水纹效果。简单水纹效果
代码片段和文件信息
/*****************************************************************************************
模 块 名:Ripper
说 明:水波特效的主程序
创 建 人:魔佳
版 本:V1.0.0
*****************************************************************************************/
#include
#include “wave.h“
#include “resource.h“
HINSTANCE hInstExe = NULL;
HWND hWnd = NULL;
WAVEobject stWaveObj;
TCHAR szClass[] = TEXT (“Ripper“);
TCHAR sztitle[] = TEXT (“水波特效“);
//TCHAR szTip[] = TEXT (“水波特效演示by罗云彬\n使用Win32汇编语言编写,源代码可见http://asm.yeah.net\n\n鼠标左键:在点击处激发水波\n鼠标右键:循环切换(下雨、快艇、波浪等)“);
//TCHAR szError[] = TEXT (“初始化水波对象错误“);
void Quit (void)
{
WaveFree (&stWaveObj);
DestroyWindow (hWnd);
PostQuitMessage (0);
}
LRESULT CALLBACK WndProc (HWND hWnd UINT message WPARAM wParam LPARAM lParam)
{
PAINTSTRUCT stPs;
HDC hDc;
HBITMAP hBmp;
UINT cx cy;
int count = 0;
switch (message) {
case WM_CREATE:
hBmp = LoadBitmap (hInstExe MAKEINTRESOURCE (IDB_BITMAP1));
WaveInit (&stWaveObj hWnd hBmp 30 0);
SetWindowPos (hWnd HWND_TOPMOST 0 0 stWaveObj.dwBmpWidth+5 stWaveObj.dwBmpHeight+25 SWP_NOMOVE);
WaveEffect (&stWaveObj 1 3 5 120);
return 0;
case WM_CLOSE:
Quit ();
return 0;
case WM_PAINT:
hDc = BeginPaint (hWnd &stPs);
WaveUpdateframe (&stWaveObj hDc TRUE);
EndPaint (hWnd &stPs);
return 0;
case WM_MOUSEMOVE:
cx = LOWORD (lParam);
cy = HIWORD (lParam);
//WaveDropStone (&stWaveObj cx cy 2 256);
return 0;
case WM_LBUTTONDOWN:
cx = LOWORD (lParam);
cy = HIWORD (lParam);
WaveDropStone (&stWaveObj cx cy 2 5000);
return 0;
case WM_RBUTTONDOWN:
switch (stWaveObj.dwEffectType) {
case 0:
WaveEffect (&stWaveObj 1 5 4 250);
break;
case 1:
WaveEffect (&stWaveObj 3 200 2 8);
break;
case 3:
WaveEffect (&stWaveObj 2 4 2 180);
break;
default:
WaveEffect (&stWaveObj 0 0 0 0);
}
return 0;
case WM_KEYDOWN:
switch (wParam) {
case 0x46:
WaveDropStone (&stWaveObj stWaveObj.dwBmpWidth*7/16 stWaveObj.dwBmpHeight/2 2 5000);
WaveDropStone (&stWaveObj stWaveObj.dwBmpWidth*9/16 stWaveObj.dwBmpHeight/2 2 5000);
WaveDropStone (&stWaveObj stWaveObj.dwBmpWidth/2 stWaveObj.dwBmpHeight/4 2 5000);
WaveDropStone (&stWaveObj stWaveObj.dwBmpWidth/2 stWaveObj.dwBmpHeight*3/4 2 5000);
WaveDropStone (&stWaveObj stWaveObj.dwBmpWidth*5/16 stWaveObj.dwBmpHeight/2 2 5000);
WaveDropStone (&stWaveObj stWaveObj.dwBmpWidth*3/16 stWaveObj.dwBmpHeight/2 2 5000);
WaveDropStone (&stWaveObj stWaveObj.dwBmpWidth*11/16 stWaveObj.dwBmpHeight/2 2 5000);
WaveDropStone (&stWaveObj stWaveObj.dwBmpWidth*13/16 stWaveObj.dwBmpHeight/2 2 5000);
break;
}
return 0;
}
return DefWindowProc (hWnd message wParam lParam);
}
int APIENTRY _tWinMain (HINSTANCE hInstance HINSTANCE LPTSTR pszCmdLine int nCmdShow)
{
MSG msg;
//注册窗口类
hInstExe = hInstance;
WNDCLASSEX
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 455 2007-11-29 05:01 VC版水波特效\Clean.bat
文件 451 2010-07-18 08:45 VC版水波特效\WaveNext\resource.h
文件 86878 2010-07-18 08:45 VC版水波特效\WaveNext\Ripper.bmp
文件 3967 2010-07-19 17:03 VC版水波特效\WaveNext\Ripper.cpp
文件 1269 2010-07-19 17:07 VC版水波特效\WaveNext\targetver.h
文件 18241 2010-07-19 17:08 VC版水波特效\WaveNext\Wave.cpp
文件 1717 2010-07-19 17:03 VC版水波特效\WaveNext\Wave.h
文件 1582 2010-07-18 08:45 VC版水波特效\WaveNext\WaveNext.rc
文件 4288 2010-07-19 17:07 VC版水波特效\WaveNext\WaveNext.vcproj
文件 890 2010-07-18 08:23 VC版水波特效\WaveNext.sln
文件 171781 2010-07-13 20:39 VC版水波特效\资料文件\WaterEffect.pdf
文件 36781 2010-07-17 21:09 VC版水波特效\资料文件\位图相关知识.htm
目录 0 2010-07-21 21:56 VC版水波特效\WaveNext
目录 0 2010-07-21 21:51 VC版水波特效\资料文件
目录 0 2010-07-21 21:56 VC版水波特效
----------- --------- ---------- ----- ----
328300 15
- 上一篇:QtImage Qt编写的图片浏览器
- 下一篇:8259A的编程初始化和编程
评论
共有 条评论