https://github.com/flipeador/water-ripple-effect
Win32 device-independent bitmap (DIB) Water Effect DLL.
https://github.com/flipeador/water-ripple-effect
autohotkey bitmap-image cpp20 dll dynamic-link-library inno-setup multithreading performant ripple-effect water-effect win32 windows-11 windows-gdi windows-xp
Last synced: 3 months ago
JSON representation
Win32 device-independent bitmap (DIB) Water Effect DLL.
- Host: GitHub
- URL: https://github.com/flipeador/water-ripple-effect
- Owner: flipeador
- Created: 2020-08-02T17:00:31.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-12T23:13:28.000Z (6 months ago)
- Last Synced: 2025-01-14T12:53:13.559Z (4 months ago)
- Topics: autohotkey, bitmap-image, cpp20, dll, dynamic-link-library, inno-setup, multithreading, performant, ripple-effect, water-effect, win32, windows-11, windows-gdi, windows-xp
- Language: AutoHotkey
- Homepage:
- Size: 5.33 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Win32 Water Effect
High-performance simulation of water ripples on a window surface in Windows.
The DLL paints an image directly on the background of a window using [Windows GDI][gdi].
![]()
#### Simulation of water ripples on a \ element in the browser:
## Examples
AutoHotkey
[`32-Bit/waterfx.ahk`](32-Bit/waterfx.ahk)
[`64-Bit/waterfx.ahk`](64-Bit/waterfx.ahk)
Inno Setup
Function definitions:
```pascal
function create(): THandle;
external 'create@files:waterfx.dll stdcall delayload';
procedure destroy(id: THandle);
external 'destroy@files:waterfx.dll stdcall delayload';
procedure load(id: THandle; bmp: HBITMAP);
external 'load@files:waterfx.dll stdcall delayload';
procedure set_hwnd(id: THandle; wnd: HWND);
external 'set_hwnd@files:waterfx.dll stdcall delayload';
procedure set_pos(id: THandle; x,y: Integer);
external 'set_pos@files:waterfx.dll stdcall delayload';
procedure set_alpha_format(id: THandle; afmt: Integer);
external 'set_alpha_format@files:waterfx.dll stdcall delayload';
procedure resize(id: THandle; width,height: Integer);
external 'resize@files:waterfx.dll stdcall delayload';
procedure autosize(id: THandle; enabled: Boolean);
external 'autosize@files:waterfx.dll stdcall delayload';
procedure blob(id: THandle; x,y,radius,height: Integer);
external 'blob@files:waterfx.dll stdcall delayload';
procedure start(id: THandle);
external 'start@files:waterfx.dll stdcall delayload';
procedure stop(id: THandle);
external 'stop@files:waterfx.dll stdcall delayload';
procedure set_density(id: THandle; density: Integer);
external 'set_density@files:waterfx.dll stdcall delayload';
procedure wm_mousemove(id: THandle; radius,height: Integer);
external 'wm_mousemove@files:waterfx.dll stdcall delayload';
procedure wm_lbuttondown(id: THandle; radius,height: Integer);
external 'wm_lbuttondown@files:waterfx.dll stdcall delayload';
procedure wm_lbuttonup(id: THandle; radius,height: Integer);
external 'wm_lbuttonup@files:waterfx.dll stdcall delayload';
```Non Resizable
```pascal
[Setup]
AppName=My App
AppVersion=1
WizardResizable=no
WizardSizePercent=100
WizardStyle=modern
OutputDir=.
DefaultDirName=\My App
DisableWelcomePage=no[Files]
Source: "waterfx.dll"; Flags: dontcopy
;Source: "logo.bmp"; Flags: dontcopy[Code]
//var
wfx: THandle;
logo: TBitmapImage;const
TOP = 50;
LEFT = 50;procedure InitializeWizard();
begin
logo := TBitmapImage.Create(WizardForm);
logo.Bitmap.LoadFromFile(ExpandConstant('{src}\logo.bmp'));WizardForm.OuterNotebook.Hide;
WizardForm.ClientWidth := logo.Bitmap.Width + 2 * LEFT;wfx := create();
load(wfx, logo.Bitmap.Handle);
//set_alpha_format(wfx, $01);
set_hwnd(wfx, WizardForm.Handle);
set_pos(wfx, LEFT, TOP);
start(wfx);// Blob on mouse events.
// Set to 0 to disable.
wm_mousemove(wfx, 2, 30);
wm_lbuttondown(wfx, 3, 300);
wm_lbuttonup(wfx, 4, 500);
end;procedure DeinitializeSetup();
begin
destroy(wfx);
WizardForm.Free;
end;
```Resizable
```pascal
[Setup]
AppName=My App
AppVersion=1
WizardResizable=yes
WizardSizePercent=100
WizardStyle=modern
OutputDir=.
DefaultDirName=\My App
DisableWelcomePage=no[Files]
Source: "waterfx.dll"; Flags: dontcopy
;Source: "logo.bmp"; Flags: dontcopy[Code]
//var
wfx: THandle;
logo: TBitmapImage;const
TOP = 50;
LEFT = 50;procedure InitializeWizard();
begin
logo := TBitmapImage.Create(WizardForm);
logo.Bitmap.LoadFromFile(ExpandConstant('{src}\logo.bmp'));WizardForm.OuterNotebook.Hide;
WizardForm.ClientWidth := logo.Bitmap.Width + 2 * LEFT;wfx := create();
load(wfx, logo.Bitmap.Handle);
resize(wfx, WizardForm.ClientWidth - 2 * LEFT, 0);
set_hwnd(wfx, WizardForm.Handle);
set_pos(wfx, LEFT, TOP);
autosize(wfx, True);
start(wfx);wm_mousemove(wfx, 2, 30);
wm_lbuttondown(wfx, 3, 300);
end;procedure DeinitializeSetup();
begin
destroy(wfx);
WizardForm.Free;
end;
```[gdi]: https://learn.microsoft.com/en-us/windows/win32/gdi/windows-gdi