I want to play a gif image using GifBitmapDecoder and Int32Animation, but I found some gif is incomplete when they were played.
Here is my gif:
And here is my test code:
GifBitmapDecoder _gifDecoder = new GifBitmapDecoder(
new Uri("pack://application:,,,/Expression/f006.gif"),
BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
foreach (BitmapFrame bf in _gifDecoder.Frames)
{
Image i = new Image { Source = bf };
wp.Children.Add(i);
}
Xaml:
<WrapPanel Name="wp" ItemHeight="40" ItemWidth="40"/>
The result:
So could you tell me what's wrong, since I have search for it two days and find nothing...