Overview

BrightTransitionEffectLib transitions between images by increasing brightness to white, then revealing the target as brightness decreases — wrapping the FireMonkey TBrightTransitionEffect component. Creates a dramatic "camera flash" or "white-out" effect.

PropertyDetails
LibraryBrightTransitionEffectLib
Prefixbrighttrans_
WrapsTBrightTransitionEffect
Functions13
TypeTransition effect
CategoryCountDescription
Creation / Destruction2Create and free effect
Target Image3Set/get/load target bitmap
Progress2Get/set transition progress
Effect Control2Enabled get/set
Error Handling4Error codes and messages
⚡ Flash Effect: At progress 0.5 the image is fully white — the "flash point." The source fades to white in the first half, then the target emerges from white in the second half. Faster animation = snappy flash, slower = gradual fade-through-white.

Cross-Platform Support

PlatformSupport
Windows✅ Full support
Linux✅ Full support
Android✅ Full support

Creation & Destruction

brighttrans#(parent#)

Creates a new bright transition effect attached to the specified visual control.

ParameterTypeDescription
parent#PointerTarget visual control
ReturnsPointerEffect handle, or 0 on failure

brighttrans_free(effect#)

Destroys the effect and releases associated resources.

Error Handling

FunctionSignatureDescription
brighttrans_error()brighttrans_error@Returns last error code (0 = none)
brighttrans_errormsg$()brighttrans_errormsg$@Returns last error message
brighttrans_strerror$(code)brighttrans_strerror$@nConverts error code to text
brighttrans_clearerror()brighttrans_clearerror@Clears the error state

Target Image

FunctionSignatureDescription
brighttrans_target#(effect#, bitmap#)brighttrans_target#@##Sets target from bitmap pointer
brighttrans_target#(effect#)brighttrans_target#@#Gets target bitmap pointer
brighttrans_loadtarget#(effect#, url$)brighttrans_loadtarget#@#$Loads target from URL or file
⚠ Target Required: Always load a target image before animating progress.

Progress

FunctionSignatureDescription
brighttrans_progress#(effect#, value)brighttrans_progress#@#nSet progress (0.0–1.0)
brighttrans_progress(effect#)brighttrans_progress@#Get current progress
ProgressVisual
0.0Source image, normal brightness
0.25Source fading to white
0.5Fully white — flash point
0.75Target emerging from white
1.0Target image, normal brightness

Effect Control

FunctionSignatureDescription
brighttrans_enabled#(effect#, value)brighttrans_enabled#@#nEnable (1) or disable (0)
brighttrans_enabled(effect#)brighttrans_enabled@#Gets enabled state

Complete Examples

Example 1: Flash Transition Animation

╯ flash-transition.bas
let frm# = Pointer#(0)
let img# = Pointer#(0)
let trans# = Pointer#(0)
let tmr# = Pointer#(0)
let btn# = Pointer#(0)
let progress = 0

frm# = form#("Flash Transition", 400, 350)

img# = image#(frm#)
image_bounds#(img#, 100, 30, 200, 150)
image_load#(img#, "https://picsum.photos/200/150?random=1")

trans# = brighttrans#(img#)
brighttrans_loadtarget#(trans#, "https://picsum.photos/200/150?random=2")

tmr# = timer#()
timer_interval#(tmr#, 25)
timer_enabled#(tmr#, 0)
timer_ontimer#(tmr#, "Animate")

btn# = button#(frm#, "Flash!")
button_bounds#(btn#, 150, 210, 100, 30)
button_onclick#(btn#, "StartFlash")

form_show(frm#)

function StartFlash(sender#)
  progress = 0
  timer_enabled#(tmr#, 1)
  button_enabled#(btn#, 0)
endfunction

function Animate(sender#)
  progress = progress + 0.03
  brighttrans_progress#(trans#, progress)
  
  if progress >= 1 then
    timer_enabled#(tmr#, 0)
    button_enabled#(btn#, 1)
  endif
endfunction

Example 2: Bi-directional Loop

╯ bright-loop.bas
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#("Bright Loop", 400, 350)

img# = image#(frm#)
image_bounds#(img#, 100, 30, 200, 150)
image_load#(img#, "https://picsum.photos/200/150?random=1")

trans# = brighttrans#(img#)
brighttrans_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 Loop")
button_bounds#(btn#, 140, 210, 120, 30)
button_onclick#(btn#, "StartLoop")

form_show(frm#)

function StartLoop(sender#)
  timer_enabled#(tmr#, 1)
  button_enabled#(btn#, 0)
endfunction

function Animate(sender#)
  progress = progress + (direction * 0.02)
  brighttrans_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

Quick Reference

FunctionSignatureDescription
CREATION & DESTRUCTION
brighttrans#(parent#)brighttrans#@#Create effect
brighttrans_free(effect#)brighttrans_free@#Destroy effect
TARGET IMAGE
brighttrans_target#(effect#, bitmap#)brighttrans_target#@##Set target bitmap
brighttrans_target#(effect#)brighttrans_target#@#Get target bitmap
brighttrans_loadtarget#(effect#, url$)brighttrans_loadtarget#@#$Load target
PROGRESS
brighttrans_progress#(effect#, value)brighttrans_progress#@#nSet progress (0–1)
brighttrans_progress(effect#)brighttrans_progress@#Get progress
EFFECT CONTROL
brighttrans_enabled#(effect#, value)brighttrans_enabled#@#nEnable/disable
brighttrans_enabled(effect#)brighttrans_enabled@#Get enabled state
ERROR HANDLING
brighttrans_error()brighttrans_error@Last error code
brighttrans_errormsg$()brighttrans_errormsg$@Last error message
brighttrans_strerror$(code)brighttrans_strerror$@nCode to text
brighttrans_clearerror()brighttrans_clearerror@Clear error state

See Also

LibraryDescription
FadeTransitionEffectLibFade to black transition
BlurTransitionEffectLibBlur-based transition
DissolveTransitionEffectLibDissolve transition