public class Main {
public static void main(String[] args) throws MalformedURLException {
URL url= new URL("<file path>");
Icon icon= new ImageIcon(url);
JLabel label= new JLabel(icon);
JFrame mainFrame = new JFrame("Test");
mainFrame.getContentPane().add(label);
mainFrame.setSize(800, 600);
mainFrame.setVisible(true);
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.setResizable(false);
}
}
如何更改 Gif 文件的速度? 我试图找到如何改变 JFrame 框架的速度,但我没有找到任何东西
最佳答案
你不能。您所能做的就是根据当前的 gif 创建另一个 gif。使用ImageMagick为此
检测当前速度:
identify -verbose your.gif | grep Delay
Delay: 5x100
...
创建一个新的 gif:
convert -delay 10x100 your.gif your_slow.gif
关于java - 如何更改 GIF 文件的速度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41650695/