アニメーションGIFを.netのコンポーネント部分にどのように分割しますか?
具体的には、それらをメモリ内のImage(s)(System.Drawing.Image)にロードしたいと思います。
======================
SLaksの答えに基づいて、私は今これを持っています
public static IEnumerable<Bitmap> GetImages(Stream stream)
{
using (var gifImage = Image.FromStream(stream))
{
//gets the GUID
var dimension = new FrameDimension(gifImage.FrameDimensionsList[0]);
//total frames in the animation
var frameCount = gifImage.GetFrameCount(dimension);
for (var index = 0; index < frameCount; index++)
{
//find the frame
gifImage.SelectActiveFrame(dimension, index);
//return a copy of it
yield return (Bitmap) gifImage.Clone();
}
}
}