How can I create an animated palette (color cycling) animation in FireMonkey?

1.3k Views Asked by At

An old-school graphics effect is palette animation, where for an image of (say) 256 colours, the palette that each color index of 0-255 refers to is shifted. As it shifts, the colours of each pixel change.

You can read more about the technique here and see a fantastic HTML5 reproduction of old-style effects here. Here is a plasma example from Wikipedia:

Color cycling from Wikipedia

I would like to achieve the same effect in FireMonkey, using FMX TBitmaps or another inbuilt class. (I currently have TBitmaps - with static colours - built once-off from a table of values.) FMX is quite abstracted from the underlying OS, and also using underlying OS techniques will stop the app being cross-platform-compatible. On the other hand, since it uses DirectX or OpenGL under the hood, fast animation effects should be very possible. What's the best approach?

I am using Delphi XE2 (original FireMonkey) but a technique for anything up to XE4 (FMX 3) is fine too.

0

There are 0 best solutions below