// --------------------------------------------------------------------------- public void AddGif(Document document, String path) { GifImage img = new GifImage(path); int n = img.GetFrameCount(); for (int i = 1; i <= n; i++) { document.Add(img.GetImage(i)); } }
public static bool CanAnimate(GifImage image) { if (image == null) { return(false); } lock (image) { var dimensions = image.FrameDimensionsList; if (dimensions.Select(guid => new GifFrameDimension(guid)).Contains(GifFrameDimension.Time)) { return(image.GetFrameCount(GifFrameDimension.Time) > 1); } } return(false); }