Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to create image from bufferedImage

Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.

I have been learning java for a short while and am enjoying makeing some games. Check on my site.

I have made to games in the form of applets. Basically the game plays on a big Gif image of about 200Kb. The scrolling image is about 4000 by 2000 high and is dragged within the applet. So its quite a big image to down load. What I would like to do is create the image in-game by composting the image from its constituent sprites. What I am trying to say is that can the buffered image be made into a Gif and saved? Is it possible to do that?

I would appreciate anyone taking the time to help me out.

Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java does not (yet) support writing gif images due to license problems.
There are free libraries available for this thoug: one of them is net.jmge.gif.Gif89Encoder

Check it out and see if it helps you.

I would suggest you have a look at the so called tile based games. Even if your game background is not repetitive like in a stadnard tile based game you can use the aproach to improve performance of your game:

The background image is split into several tiles (probably square shaped images of say 64*64 pixels (usualy a power of 2).
If your view is 200 * 200 pixels then you need to show 4 * 4 images at once. Well i guess you get the picture (no pun intended :-)). Check out for an idea how this could work.
You will probably find code that does this if you do not want to do it yourself...

I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic