Overview
RadialBlurEffectLib applies a radial (zoom) blur emanating from a center point, wrapping the FireMonkey TRadialBlurEffect component. The effect creates a motion blur as if zooming in or out from the center — commonly used for speed, focus, or dramatic emphasis effects.
| Property | Details |
|---|---|
| Library | RadialBlurEffectLib |
| Prefix | radblur_ |
| Wraps | TRadialBlurEffect |
| Functions | 16 |
| Type | Visual effect (blur) |
| Category | Count | Description |
|---|---|---|
| Creation / Destruction | 2 | Create and free effect |
| Blur Amount | 2 | Get/set blur intensity |
| Center Position | 4 | Get/set X,Y center (0–1) |
| Effect Control | 4 | Enabled and trigger get/set |
| Error Handling | 4 | Error codes and messages |
💨 Zoom Blur: Unlike Gaussian or Box blur which spread evenly, radial blur streaks outward from a center point — like zooming a camera during a long exposure. Great for action or speed effects.
Cross-Platform Support
| Platform | Support |
|---|---|
| Windows | ✅ Full support |
| Linux | ✅ Full support |
| Android | ✅ Full support |
Creation & Destruction
radblur#(parent#)
Creates a new radial blur effect attached to the specified visual control.
| Parameter | Type | Description |
|---|---|---|
parent# | Pointer | Target visual control |
| Returns | Pointer | Effect handle, or 0 on failure |
radblur_free(effect#)
Destroys the effect and releases associated resources.
Error Handling
| Function | Signature | Description |
|---|---|---|
radblur_error() | radblur_error@ | Returns last error code (0 = none) |
radblur_errormsg$() | radblur_errormsg$@ | Returns last error message |
radblur_strerror$(code) | radblur_strerror$@n | Converts error code to text |
radblur_clearerror() | radblur_clearerror@ | Clears the error state |
Blur Amount
Controls the intensity of the radial blur. Higher values produce stronger zoom-blur streaks.
| Function | Signature | Description |
|---|---|---|
radblur_bluramount#(effect#, value) | radblur_bluramount#@#n | Set blur intensity (0–10) |
radblur_bluramount(effect#) | radblur_bluramount@# | Get blur amount |
| Value | Effect | Use Case |
|---|---|---|
0–0.5 | Very subtle | Soft focus background |
1–3 | Gentle zoom blur | Subtle speed/depth feel |
4–7 | Medium intensity | Action or motion emphasis |
8–10 | Strong zoom streaks | Dramatic speed effect |
Center Position
Normalized coordinates (0–1) specifying where the blur radiates from.
| Function | Signature | Description |
|---|---|---|
radblur_centerx#(effect#, value) | radblur_centerx#@#n | Set X center (0=left, 1=right) |
radblur_centerx(effect#) | radblur_centerx@# | Get X center |
radblur_centery#(effect#, value) | radblur_centery#@#n | Set Y center (0=top, 1=bottom) |
radblur_centery(effect#) | radblur_centery@# | Get Y center |
Effect Control
| Function | Signature | Description |
|---|---|---|
radblur_enabled#(effect#, value) | radblur_enabled#@#n | Enable (1) or disable (0) |
radblur_enabled(effect#) | radblur_enabled@# | Gets enabled state |
radblur_trigger#(effect#, trigger$) | radblur_trigger#@#$ | Sets trigger string |
radblur_trigger$(effect#) | radblur_trigger$@# | Gets trigger string |
Complete Examples
Example 1: Basic Radial Blur
let frm# = Pointer#(0) let img# = Pointer#(0) let blur# = Pointer#(0) frm# = form#("Radial Blur Demo", 400, 350) img# = image#(frm#) image_bounds#(img#, 100, 30, 200, 150) image_load#(img#, "https://picsum.photos/200/150") ' Apply radial (zoom) blur blur# = radblur#(img#) radblur_bluramount#(blur#, 2) form_show(frm#)
Example 2: Adjustable Blur Intensity
let frm# = Pointer#(0) let img# = Pointer#(0) let blur# = Pointer#(0) let trkBlur# = Pointer#(0) let lblBlur# = Pointer#(0) frm# = form#("Radial Blur Control", 450, 400) img# = image#(frm#) image_bounds#(img#, 125, 30, 200, 150) image_load#(img#, "https://picsum.photos/200/150") blur# = radblur#(img#) radblur_bluramount#(blur#, 0) lblBlur# = label#(frm#, "Blur: 0.0", 180, 200) trkBlur# = trackbar#(frm#) trackbar_bounds#(trkBlur#, 50, 230, 350, 30) trackbar_max#(trkBlur#, 100) trackbar_value#(trkBlur#, 0) trackbar_onchange#(trkBlur#, "OnBlurChange") form_show(frm#) function OnBlurChange(sender#) local b let b = trackbar_value(trkBlur#) / 10 radblur_bluramount#(blur#, b) label_text#(lblBlur#, "Blur: " + stri$(b, 1)) endfunction
Example 3: Move Blur Center
let frm# = Pointer#(0) let img# = Pointer#(0) let blur# = Pointer#(0) let trkX# = Pointer#(0) let trkY# = Pointer#(0) let lblX# = Pointer#(0) let lblY# = Pointer#(0) frm# = form#("Radial Blur Center", 500, 470) img# = image#(frm#) image_bounds#(img#, 150, 20, 200, 150) image_load#(img#, "https://picsum.photos/200/150") blur# = radblur#(img#) radblur_bluramount#(blur#, 3) lblX# = label#(frm#, "Center X: 0.50", 30, 190) trkX# = trackbar#(frm#) trackbar_bounds#(trkX#, 30, 215, 440, 25) trackbar_max#(trkX#, 100) trackbar_value#(trkX#, 50) trackbar_onchange#(trkX#, "OnCenterX") lblY# = label#(frm#, "Center Y: 0.50", 30, 260) trkY# = trackbar#(frm#) trackbar_bounds#(trkY#, 30, 285, 440, 25) trackbar_max#(trkY#, 100) trackbar_value#(trkY#, 50) trackbar_onchange#(trkY#, "OnCenterY") form_show(frm#) function OnCenterX(sender#) local x let x = trackbar_value(trkX#) / 100 radblur_centerx#(blur#, x) label_text#(lblX#, "Center X: " + stri$(x, 2)) endfunction function OnCenterY(sender#) local y let y = trackbar_value(trkY#) / 100 radblur_centery#(blur#, y) label_text#(lblY#, "Center Y: " + stri$(y, 2)) endfunction
Best Practices
| Practice | Why |
|---|---|
| Use values 1–3 for subtle effects | Higher values are very dramatic |
| Center on the subject of interest | Draws focus to the center point |
| Map slider 0–100 ÷ 10 for range 0–10 | Provides smooth control via trackbar |
| Combine with other blur types for variety | Directional for motion, Gaussian for softness, Radial for zoom |
Quick Reference
| Function | Signature | Description |
|---|---|---|
| CREATION & DESTRUCTION | ||
radblur#(parent#) | radblur#@# | Create effect |
radblur_free(effect#) | radblur_free@# | Destroy effect |
| BLUR AMOUNT | ||
radblur_bluramount#(effect#, value) | radblur_bluramount#@#n | Set blur (0–10) |
radblur_bluramount(effect#) | radblur_bluramount@# | Get blur |
| CENTER POSITION | ||
radblur_centerx#(effect#, value) | radblur_centerx#@#n | Set X center (0–1) |
radblur_centerx(effect#) | radblur_centerx@# | Get X center |
radblur_centery#(effect#, value) | radblur_centery#@#n | Set Y center (0–1) |
radblur_centery(effect#) | radblur_centery@# | Get Y center |
| EFFECT CONTROL | ||
radblur_enabled#(effect#, value) | radblur_enabled#@#n | Enable/disable |
radblur_enabled(effect#) | radblur_enabled@# | Get enabled state |
radblur_trigger#(effect#, trigger$) | radblur_trigger#@#$ | Set trigger |
radblur_trigger$(effect#) | radblur_trigger$@# | Get trigger |
| ERROR HANDLING | ||
radblur_error() | radblur_error@ | Last error code |
radblur_errormsg$() | radblur_errormsg$@ | Last error message |
radblur_strerror$(code) | radblur_strerror$@n | Code to text |
radblur_clearerror() | radblur_clearerror@ | Clear error state |
See Also
| Library | Description |
|---|---|
DirectionalBlurEffectLib | Linear motion blur |
GaussianBlurEffectLib | Smooth general blur |
BoxBlurEffectLib | Fast box blur |
BlurEffectLib | Standard blur effect |
