Overview
BlurTransitionEffectLib creates a smooth, dreamy transition that blurs the source image while cross-fading to the target, wrapping the FireMonkey TBlurTransitionEffect component. The image blurs at the midpoint and sharpens at both ends — a soft, professional-looking transition ideal for photo slideshows.
| Property | Details |
|---|---|
| Library | BlurTransitionEffectLib |
| Prefix | blurtrans_ |
| Wraps | TBlurTransitionEffect |
| Functions | 13 |
| Type | Transition effect |
| Category | Count | Description |
|---|---|---|
| Creation / Destruction | 2 | Create and free effect |
| Target Image | 3 | Set/get/load target bitmap |
| Progress | 2 | Get/set transition progress |
| Effect Control | 2 | Enabled get/set |
| Error Handling | 4 | Error codes and messages |
📸 Dreamy Crossfade: This is one of the simplest transition effects — just progress from 0 to 1. The blur peaks at the midpoint, making the image change feel natural and smooth. Great for photo slideshows and presentations.
Cross-Platform Support
| Platform | Support |
|---|---|
| Windows | ✅ Full support |
| Linux | ✅ Full support |
| Android | ✅ Full support |
Creation & Destruction
blurtrans#(parent#)
Creates a new blur transition effect attached to the specified visual control.
| Parameter | Type | Description |
|---|---|---|
parent# | Pointer | Target visual control |
| Returns | Pointer | Effect handle, or 0 on failure |
blurtrans_free(effect#)
Destroys the effect and releases associated resources.
Error Handling
| Function | Signature | Description |
|---|---|---|
blurtrans_error() | blurtrans_error@ | Returns last error code (0 = none) |
blurtrans_errormsg$() | blurtrans_errormsg$@ | Returns last error message |
blurtrans_strerror$(code) | blurtrans_strerror$@n | Converts error code to text |
blurtrans_clearerror() | blurtrans_clearerror@ | Clears the error state |
Target Image
| Function | Signature | Description |
|---|---|---|
blurtrans_target#(effect#, bitmap#) | blurtrans_target#@## | Sets target from bitmap pointer |
blurtrans_target#(effect#) | blurtrans_target#@# | Gets target bitmap pointer |
blurtrans_loadtarget#(effect#, url$) | blurtrans_loadtarget#@#$ | Loads target from URL or file |
⚠ Target Required: Always load a target image before animating progress.
Progress
| Function | Signature | Description |
|---|---|---|
blurtrans_progress#(effect#, value) | blurtrans_progress#@#n | Set progress (0.0–1.0) |
blurtrans_progress(effect#) | blurtrans_progress@# | Get current progress |
At 0, the source is shown sharply. Around 0.5, maximum blur occurs as images cross-fade. At 1, the target is shown sharply.
Effect Control
| Function | Signature | Description |
|---|---|---|
blurtrans_enabled#(effect#, value) | blurtrans_enabled#@#n | Enable (1) or disable (0) |
blurtrans_enabled(effect#) | blurtrans_enabled@# | Gets enabled state |
Complete Examples
Example 1: Animated Blur Transition
let frm# = Pointer#(0) let img# = Pointer#(0) let trans# = Pointer#(0) let tmr# = Pointer#(0) let btn# = Pointer#(0) let progress = 0 let direction = 1 frm# = form#("Animated Blur", 400, 350) img# = image#(frm#) image_bounds#(img#, 100, 30, 200, 150) image_load#(img#, "https://picsum.photos/200/150?random=1") trans# = blurtrans#(img#) blurtrans_loadtarget#(trans#, "https://picsum.photos/200/150?random=2") tmr# = timer#() timer_interval#(tmr#, 30) timer_enabled#(tmr#, 0) timer_ontimer#(tmr#, "Animate") btn# = button#(frm#, "Start Transition") button_bounds#(btn#, 130, 210, 140, 30) button_onclick#(btn#, "StartAnim") form_show(frm#) function StartAnim(sender#) timer_enabled#(tmr#, 1) button_enabled#(btn#, 0) endfunction function Animate(sender#) progress = progress + (direction * 0.02) blurtrans_progress#(trans#, progress) if progress >= 1 then direction = -1 endif if progress <= 0 then direction = 1 timer_enabled#(tmr#, 0) button_enabled#(btn#, 1) endif endfunction
Example 2: Toggle Effect On/Off
let frm# = Pointer#(0) let img# = Pointer#(0) let trans# = Pointer#(0) let btn# = Pointer#(0) let isOn = 1 frm# = form#("Toggle Blur Trans", 400, 300) img# = image#(frm#) image_bounds#(img#, 100, 30, 200, 150) image_load#(img#, "https://picsum.photos/200/150?random=1") trans# = blurtrans#(img#) blurtrans_loadtarget#(trans#, "https://picsum.photos/200/150?random=2") blurtrans_progress#(trans#, 0.5) btn# = button#(frm#, "Disable Effect") button_bounds#(btn#, 140, 210, 120, 30) button_onclick#(btn#, "Toggle") form_show(frm#) function Toggle(sender#) if isOn = 1 then blurtrans_enabled#(trans#, 0) isOn = 0 button_text#(btn#, "Enable Effect") else blurtrans_enabled#(trans#, 1) isOn = 1 button_text#(btn#, "Disable Effect") endif endfunction
Quick Reference
| Function | Signature | Description |
|---|---|---|
| CREATION & DESTRUCTION | ||
blurtrans#(parent#) | blurtrans#@# | Create effect |
blurtrans_free(effect#) | blurtrans_free@# | Destroy effect |
| TARGET IMAGE | ||
blurtrans_target#(effect#, bitmap#) | blurtrans_target#@## | Set target bitmap |
blurtrans_target#(effect#) | blurtrans_target#@# | Get target bitmap |
blurtrans_loadtarget#(effect#, url$) | blurtrans_loadtarget#@#$ | Load target |
| PROGRESS | ||
blurtrans_progress#(effect#, value) | blurtrans_progress#@#n | Set progress (0–1) |
blurtrans_progress(effect#) | blurtrans_progress@# | Get progress |
| EFFECT CONTROL | ||
blurtrans_enabled#(effect#, value) | blurtrans_enabled#@#n | Enable/disable |
blurtrans_enabled(effect#) | blurtrans_enabled@# | Get enabled state |
| ERROR HANDLING | ||
blurtrans_error() | blurtrans_error@ | Last error code |
blurtrans_errormsg$() | blurtrans_errormsg$@ | Last error message |
blurtrans_strerror$(code) | blurtrans_strerror$@n | Code to text |
blurtrans_clearerror() | blurtrans_clearerror@ | Clear error state |
See Also
| Library | Description |
|---|---|
FadeTransitionEffectLib | Simple fade transition |
DissolveTransitionEffectLib | Dissolve transition |
BrightTransitionEffectLib | Brightness-based transition |
