• Post Reply Bookmark Topic Watch Topic
  • New Topic

how can i make a .gif file ?  RSS feed

 
wang daokui
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i used GifEncoder,it threw a exception as followed:
java.io.IOException: can't encode as GIF (> 256 colors)
what is the matter ?how can i do with the problem?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What package is your GifEncoder in... I found it in several packages on the internet...

and from the error it looks like you're providing an Image that uses greater than 256 colors and the encoder can't handle it... but as to why it is throwing that exception,
 
Ashish Mahajan
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi wang,
This is not the direct sol. but what if we use write methods of javax.imageio.ImageIO for creating gif file..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!