1

guys. I'm making a plugin for JetBrains products. Here is the link: plugin link. How can I change the size of an animated gif in java code? I didn't find a solution that would help me.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Nikita
  • 21
  • 1
  • Resized at runtime so you can display it our resized so you can output it? – MadProgrammer Jun 23 '21 at 10:22
  • @MadProgrammer I didn't understand your question. I have the path to the gif passed to the input and I need to somehow resize the gif to 20*20 and output – Nikita Jun 24 '21 at 14:21
  • An animated GIF can easily be resized in HTML (which Swing components will render). But it is not clear to me if by 'output' you mean to the screen - where an `ImageIcon` is relevant, or to disk, where it is not. So please clarify which of the two 'outputs' you mean. – Andrew Thompson Jun 24 '21 at 21:04
  • The question is, do you only want the GIF to be resized while it's been displayed, which is "relatively" easy, or, do you want to resize and save the gif to a new file, which is actually, quite hard – MadProgrammer Jun 24 '21 at 21:39
  • [Displayable/resiable example](https://stackoverflow.com/questions/49826647/java-problems-with-gif-in-label/49826803#49826803) – MadProgrammer Jun 24 '21 at 21:43
  • Now, if you want to convert the source gif, then you'll need something more like [this example](https://stackoverflow.com/questions/18117283/mirroring-animated-gif-on-load-in-java-imageicon/18117326#18117326) ... good luck with that – MadProgrammer Jun 24 '21 at 21:47

0 Answers0