animated-gif

IE7/IE8 and frozen animated gifs

强颜欢笑 提交于 2019-12-18 12:16:38
问题 I'm quite sure this is an old problem. This is how i render my animated gif: <img id='loading' alt='loading' style="display: none; position: relative; left:10px; top:2px;" src="<%= Url.Image("loading.gif") %>" /> This is how I'm desperately trying to show it at the moment: showLoading: function(gifId, butId) { var n = gifId != undefined ? gifId : 'loading'; var l = $('#' + n); //if browser is stupid if ('v' == '\v') { var s = l.attr('src'); var x = document.getElementById(n); x.style

Usage of gif in ImageButton

孤街浪徒 提交于 2019-12-18 09:47:00
问题 How to toggle between an animated GIF image and a static one in ImageButton's src when someone clicks it? in onCreate() I have this aButton3 = (ImageButton) findViewById(R.id.imageButton3); SharedPreferences sharedPreferences = getSharedPreferences("NAME", Context.MODE_PRIVATE); Boolean e = sharedPreferences.getBoolean("clicked3", false); The following gets executed when someone clicks the ImageButton public void buttonClick2(View v) { SharedPreferences sharedPreferences =

Writing an animated gif from BufferedImages

半城伤御伤魂 提交于 2019-12-18 09:13:32
问题 I have a program that loads a spritesheet, creates BufferedImages of each frame on the sheet, and writes it to an animated gif. Using the class provided by Elliot Kroo on Creating animated GIF with ImageIO?, I was able to successfully output a file. However, the gif doesn't animate quite right. The sheet I provided was a .png with a transparent background, so every subsequent frame is just put on top of the last frames, with differences showing through the transparent background (Example).

Displaying animated GIFs in Tkinter using PIL

为君一笑 提交于 2019-12-18 08:57:14
问题 I'm trying to make a program to display an animated GIF using Tkinter. Here is the code that I originally used: from __future__ import division # Just because division doesn't work right in 2.7.4 from Tkinter import * from PIL import Image,ImageTk import threading from time import sleep def anim_gif(name): ## Returns { 'frames', 'delay', 'loc', 'len' } im = Image.open(name) gif = { 'frames': [], 'delay': 100, 'loc' : 0, 'len' : 0 } pics = [] try: while True: pics.append(im.copy()) im.seek(len

Animated GIF on a JButton, play it when mouse is hovered

假装没事ソ 提交于 2019-12-18 06:47:27
问题 Icon icon = new ImageIcon(getClass().getResource( "/img/icon.gif" ) ); aButton = new JButton("Its a button", icon); Is there some kind of method that can stop an animated from playing? I was thinking of assigning a static jpg of the gif, then when I hover, assign the animated gif, but I don't think there is an event for taking off mouse in MouseMotionListener so I can load back the static jpg. The gif loops in the button, however, if I hover over it, it disappears. How can I make the gif

Animated GIF on a JButton, play it when mouse is hovered

守給你的承諾、 提交于 2019-12-18 06:46:25
问题 Icon icon = new ImageIcon(getClass().getResource( "/img/icon.gif" ) ); aButton = new JButton("Its a button", icon); Is there some kind of method that can stop an animated from playing? I was thinking of assigning a static jpg of the gif, then when I hover, assign the animated gif, but I don't think there is an event for taking off mouse in MouseMotionListener so I can load back the static jpg. The gif loops in the button, however, if I hover over it, it disappears. How can I make the gif

Javascript to only display animated gif when loaded

十年热恋 提交于 2019-12-17 20:39:29
问题 I have an animated gif banner on my website that is around 2MB. For people with slow connections, I want to include some Javascript that will only display (and start playing) this gif when it is fully loaded, so that the rest of the website will already display whilst the gif is still loading. Ideally, I would have one image (loading.gif) be displayed first, and then switched to the banner (banner.gif) with javascript when banner.gif is loaded. How do I do this? (I'm new to Javascript) Thanks

Restart a gif animation without reloading the file

一曲冷凌霜 提交于 2019-12-17 20:17:15
问题 Is it possible to restart a gif animation without downloading the file every time? My current code looks like this: var img = new Image(); img.src = 'imgages/src/myImage.gif'; $('#id').css('background-image', 'url("' + img.src + '?x=' + Date.now() + '")' ); Edit When I insert the gif into the dom it didn't restart the gif animation. I can only achieve this by appending a random string to the image src but this will download the image again. I want to know if it is possible to restart the gif

C# How to stop animated gif from continually looping

雨燕双飞 提交于 2019-12-17 20:10:12
问题 I have an event that gets called when my app uses the internet. The event changes an animated gif composed of 7 frames. How do I make it only loop through the frames only once? private void trafficSendingActive(object sender, trafficEventArgs e) { txImage.Image = Properties.Resources.blip; } 回答1: You could use the System.Drawing.ImageAnimator to start/stop the gif animation // start System.Drawing.ImageAnimator.Animate(txImage.Image, OnFrameChanged); // stop System.Drawing.ImageAnimator

Watermark on animated gif with php

浪尽此生 提交于 2019-12-17 19:48:18
问题 I need a function that adds a watermark to an animated gif. How I can do that with PHP and ImageMagick? This is my code, but it doesn't work. function IMagickWatermark($sf, $sfDest, $sfLogo, $sGravity='southeast'){ //$sCmd = "composite -compose bumpmap -gravity $sGravity $sfLogo \"$sf\" $sfDest"; $sCmd = "convert \"$sf\" -coalesce -gravity south -draw 'image over 0,0 0,0 \"$sfLogo\"' \"$sfDest\""; exec($sCmd); return 1; } $sf = $_SERVER['DOCUMENT_ROOT']."/test/source.gif"; $sfDest = $_SERVER[