animated-gif

Can you control GIF animation with Javascript?

与世无争的帅哥 提交于 2019-11-26 03:55:56
问题 Is it possible to use javascript to control which frame of a GIF image is showing and/or stop the animation. I want to be able to load a GIF with several frames and only show one of them. I know I could do it with lots of separate images, but if I can do what I want with a GIF , it will only be one file to worry about. 回答1: You can do it with a single image using CSS sprites. 回答2: You can use the libgif library. It allows you to start/stop the gif and control which frame the gif is on.

Create and export an animated gif via iOS?

隐身守侯 提交于 2019-11-26 03:46:52
问题 I have a series of user-customized images within an iOS app that are being animated in a simple, frame-by-frame flip book style. My question is this: is there a way to allow users to export their animation as an animated gif? Ideally, I\'d like to enable them to email, social share (T/FB) or (worst case..) save an animated gif to their documents folder for retrieval via iTunes. I know how to save a .png to the photo library, and I found a way to record an animation as a QT file (http://www

Animated GIF in IE stopping

一个人想着一个人 提交于 2019-11-26 03:36:47
Does anyone know a work around to make animated GIF's continue to be animated after you click a link or submit a form on the page your on in IE? This works fine in other browsers. Thanks. j.davies The accepted solution did not work for me. After some more research I came across this workaround , and it actually does work. Here is the gist of it: function showProgress() { var pb = document.getElementById("progressBar"); pb.innerHTML = '<img src="./progress-bar.gif" width="200" height ="40"/>'; pb.style.display = ''; } and in your html: <input type="submit" value="Submit" onclick="showProgress()

Effective gif/image color quantization?

六眼飞鱼酱① 提交于 2019-11-26 03:25:27
问题 So I\'m trying to encode some animated gif files in my Java application. I\'ve been using some classes/algorithms found online, but none seem to be working well enough. Right now I\'m using this quantize class to reduce the colors of an image down to 256: http://www.java2s.com/Code/Java/2D-Graphics-GUI/Anefficientcolorquantizationalgorithm.htm The problem is, it doesn\'t seem to be very \"smart.\" If I pass in an image with more than 256 colors, it does reduce the color number, but not very

How do you show animated GIFs on a Windows Form (c#)

假如想象 提交于 2019-11-26 03:06:48
问题 I have a form showing progress messages as a fairly long process runs. It\'s a call to a web service so I can\'t really show a percentage complete figure on a progress bar meaningfully. (I don\'t particularly like the Marquee property of the progress bar) I would like to show an animated GIF to give the process the feel of some activity (e.g. files flying from one computer to another like Windows copy process). How do you do this? 回答1: It's not too hard. Drop a picturebox onto your form. Add

Resize animated GIF file without destroying animation

夙愿已清 提交于 2019-11-26 02:28:52
问题 I need to resize an animated GIF file without destroying the animation. How can I do it using PHP? 回答1: if you have imagemagick access, you can do this: system("convert big.gif -coalesce coalesce.gif"); system("convert -size 200x100 coalesce.gif -resize 200x10 small.gif"); this is most likely possible with the imagemagick plugin if you don't have system() access NOTE: this may create a larger filesize though a smaller dimensions image due to coalescing essentially deoptimizing the image.

Stopping GIF Animation Programmatically

試著忘記壹切 提交于 2019-11-26 02:07:10
问题 I am developing a Twitter application which references to the images directly from Twitter. How can I prevent animated gifs from being played? Using window.stop() at the end of the page does not work for me in Firefox. Is there a better JavaScript hack? Preferable this should work for all browsers 回答1: Inspired by the answer of @Karussell I wrote Gifffer. Check it out here https://github.com/krasimir/gifffer It automatically adds stop/play control on top of your Gif. 回答2: This is not a cross

Animated GIF in IE stopping

前提是你 提交于 2019-11-26 01:53:02
问题 Does anyone know a work around to make animated GIF\'s continue to be animated after you click a link or submit a form on the page your on in IE? This works fine in other browsers. Thanks. 回答1: The accepted solution did not work for me. After some more research I came across this workaround, and it actually does work. Here is the gist of it: function showProgress() { var pb = document.getElementById("progressBar"); pb.innerHTML = '<img src="./progress-bar.gif" width="200" height ="40"/>'; pb

Show an animated BG in Swing

时间秒杀一切 提交于 2019-11-26 01:28:49
问题 An animated (cycling) GIF can be displayed in a JLabel or in HTML (in formatted text components like JEditorPane ) and be seen to cycle. But to load an image to paint as the background of a container, I would typically use either ImageIO.read() or Toolkit.getImage() (the latter when I\'m feeling nostalgic for the last millennium). Neither method of loading an image results in a cycling image, it is typically just the first frame. How to load an animated image for a background? 回答1: Using

How do I get an animated gif to work in WPF?

与世无争的帅哥 提交于 2019-11-26 01:26:46
问题 What control type should I use - Image , MediaElement , etc.? 回答1: I couldn't get the most popular answer to this question (above by Dario) to work properly. The result was weird, choppy animation with weird artifacts. Best solution I have found so far: https://github.com/XamlAnimatedGif/WpfAnimatedGif You can install it with NuGet PM> Install-Package WpfAnimatedGif and to use it, at a new namespace to the Window where you want to add the gif image and use it as below <Window x:Class=