Reputation: 2128
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.
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 100x100 = 10000 sequences.
So; is it possible to composite 2 animated layers in Delphi, without too much synch loss?
Duck
Upvotes: 1
Views: 587
Reputation: 612874
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 320x120 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.
Upvotes: 3
Reputation: 734
let it in two Panels. And use GDI+ to let the Panels have transparency. Or you can use RaizeComponents's RzPanel, it has alpha attribute.
Upvotes: 1