杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2180|回复: 0

INNO 水纹特效

[复制链接]
发表于 2017-2-26 14:11:15 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. ; waterctrl.dll 为一个用于 Inno Setup 的 16.5 KB 的水纹特效插件。
  2. ; 需要注意,插件使用 MFC, 系统需要有 mfc42.dll,不过一般系统自带。

  3. ; v2 版本  新增设置水纹插件的父句柄

  4. [Setup]
  5. AppName=我的程序
  6. AppVerName=我的程序 版本 1.5
  7. DefaultDirName={pf}\我的程序
  8. DefaultGroupName=我的程序
  9. UninstallDisplayIcon={app}\MyProg.exe
  10. Compression=lzma

  11. [Files]
  12. Source: "MyProg.exe"; DestDir: "{app}"
  13. Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
  14. Source: "waterctrl.dll"; Flags: dontcopy
  15. Source: "WizModernImage-Is.bmp"; Flags: dontcopy

  16. [Icons]
  17. Name: "{group}\我的程序"; Filename: "{app}\MyProg.exe"

  18. [code]

  19. function enablewater(ParentWnd: HWND; Left, Top: integer; Bmp: HBITMAP;
  20.      WaterRadius, WaterHeight: integer): BOOL; external 'enablewater@files:waterctrl.dll stdcall';
  21. //ParentWnd     放置特效窗口的父窗口句柄。
  22. //Left          左位置
  23. //Top           上位置
  24. //Bmp           位图句柄。
  25. //WaterRadius   水纹半径,会令到水纹看起来范围更广。
  26. //WaterHeight   水纹高度,会令到水纹看起来更深。
  27. //注意,水纹插件自动根据图片来设定高度和宽度,
  28. //另外水纹底图必须是翻转的图片,显示的时候会翻转图片来显示。

  29. function waterblob(x, y: integer; radius, height: integer): BOOL; external 'waterblob@files:waterctrl.dll stdcall';
  30. // 在 x,y 点产生半径为radius, 高度为height 的水纹。

  31. function flattenwater(): BOOL; external 'flattenwater@files:waterctrl.dll stdcall';
  32. // 平伏所有水纹。

  33. function disablewater(): BOOL; external 'disablewater@files:waterctrl.dll stdcall';
  34. //释放水纹插件

  35. function setwaterparent(ParentWnd: HWND): BOOL; external 'setwaterparent@files:waterctrl.dll stdcall';
  36. //v2 新增,设置水纹插件的父句柄

  37. var
  38.   bmp: TBitmap;

  39. procedure InitializeWizard();
  40. begin
  41.   ExtractTemporaryFile('WizModernImage-Is.bmp');
  42.   bmp := TBitmap.create;
  43.   bmp.LoadFromFile(ExpandConstant('{tmp}\WizModernImage-Is.bmp'));

  44.   enablewater(WizardForm.WelcomePage.Handle, 0, 0, bmp.Handle, 3, 50);
  45. end;

  46. procedure CurPageChanged(CurPageID: Integer);
  47. begin
  48.   if CurPageID = wpWelcome then
  49.   begin
  50.     setwaterparent(WizardForm.WelcomePage.Handle);
  51.     waterblob(70, 198, 10, 1000);
  52.   end else
  53.   if CurPageID = wpFinished then
  54.   begin
  55.     setwaterparent(WizardForm.FinishedPage.Handle);
  56.     waterblob(70, 198, 10, 1000);
  57.   end else
  58.     flattenwater();
  59. end;

  60. procedure DeinitializeSetup();
  61. begin
  62.   disablewater();
  63.   bmp.Free;
  64. end;

复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-5-19 15:26 , Processed in 0.127410 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表