You can split area to array of TBox ,then use PixelShiftMulti
BTW. It's quite clever idea.
Edit:
Just commited this:
function MSToTBA (row ,col : integer) : array of TBox;
var
a ,l,w,h :integer;
begin
l := row*col;
w := (MSX2-MSX1)/col;
h := (MSY2-MSY1)/row;
SetLength(Result,l);
for a:= 0 to l-1 do
begin
Result[a].x1 := MSX1 + w * (a mod col);
Result[a].x2 := Result[a].x1 + w;
Result[a].y1 := MSY1 + h * (a div col);
Result[a].y2 := Result[a].y1 + h;
end;
end;
procedure ShowMotion;
var
a,h ,threshold: integer;
TIA : TintegerArray;
TBA : array of TBox;
begin
threshold := 60;
TBA := MStoTBA(20,22);
SMART_DrawBoxes(TRUE,TBA,clred);
h := High(TBA);
wait(2000);
repeat
TIA := PixelShiftMulti(TBA,50);
for a := 0 to h do
if TIA[a] > threshold then SMART_DrawCircle(FALSE,MiddleBox(TBA[a]),4,TRUE,clgreen);
SMART_ClearCanvas;
until (false)
end;
Run and see what happen :)