views:

547

answers:

1

Hi, I've searched around quite a bit on the Internet and I'm now pulling my hair out. I reckon this should be relatively simple. I'm sure I'm not the first person to want to do this.

Here's what I want to do:

  1. I want to 'compile' a custom animation, from still images, and save it as an avi, or some other [animation] file format. As long as it is a single file.

    • I already have the images/frames as PNG's with a transparent background and shadow (i.e. alpha channel).
    • I want the shadow/transparency/alpha channel to be maintained in the finished animation.
    • If the images/frames need to be converted into another format it can be done.
  2. I want to host this animation inside a .net windows.forms control and be able to play it on a loop (like the animation you get in Windows XP when you copy a file).

    • The reason I want the transparency to be maintained in the animation is that I want to display a custom image behind the animation and change the image at run-time depending on what is going on.

Okay, thats what I want to do. Here is what I know, and don't know.

I've downloaded and tried several different animation creating applications. Mainly around creating .avi files from .bmp files. I've used these applications to successfully create animations, don't know if the transparency is preserved, more below. I can play the animation in a windows form control using MCISendString and/or DirectX.DirectShow.

However, when I play the animation the background is black, not transparent. What I don't know is, is this because the animation does not contain the transparent data or is it because the player does not support transparency?

Excuse me if some of the terminology is wrong, hopefully you get the gist.

Losing hair quickly...

Keith.

+2  A: 

Can you change the background colour of the animation to the same colour as the window it will be played upon? This would make it look transparent, as it's the same colour as the window.

Alternatively, can you make a GIF out of the BMPs in Fireworks? (GIMP may be able to do this too). The GIF may be a bit more lightweight than a AVI in the application, and it may hold up on the transparency side too.

glasnt
I need to display an image behind the animation. So changing the background colour isn't an option.As for an animated GIF I didn't think they supported alpha channels? Maybe be a possibility if I don't get a more desireable solution.
Keith Moore
GIFs, if you make them right, should be transparent. I've ended up with a few bright pink ones before, but its not to hard to fix that up. I know they will be transparent on a webpage, so I'm assuming they should be transparent in .net.
glasnt
Transparent - yes, alpha channel - i don't think so. The alpha channel allows you to specify a level of opacity/transparency. For example: with alpha channels you can specify the colour blue with an opacity of 50%. When the image is rendered the 50% opaque blue is bleneded with the colour/image below. This technique is use to produce the smooth shadow of icons in XP/vista/7.With basic transparency, which i think is available with GIF's you can say the pixel is either a [solid] colour or transparent, not 50% transparent.
Keith Moore