I need to display an animation, composed of 2 layers with alpha transparency. I need this so I can decide and show the right combination on the fly.
- We can use png sequences, videos with alpha, or anything else.
- The animation is short, 8 secs, 15 fps, 320×120 pixels, no audio.
It’s not feasible to pre-render each combination, because we have 2 layers, 100 variations each, which need to blend over a fixed static background; that would need 100×100 = 10000 sequences.
So; is it possible to composite 2 animated layers in Delphi, without too much synch loss?
Duck
You could use a 3rd party graphics library such as Graphics32. You’d build each frame into an in memory bitmap and then blit it to the screen. Achieving flicker free 15fps at 320×120 would be easy – I reckon you could get more than 10 times the frame rate with some ease.
On the other hand I don’t think it would be too hard to just draw it onto a TPaintBox with plain GDI commands.