• Post Reply Bookmark Topic Watch Topic
  • New Topic

saving graphics  RSS feed

 
hennie louw
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just a beginer but I had an Idea....
thanks to this lovely forum I've learnd how to do animation
by useing a buch of gif file and loading them into a Graphics object but and then playing them.
but that means a lot of gif files so my idea was, can one not create a graphics array and load all the gifs in it then save it to the haddrive by using the "objectoutputstream" class and wrapping it in an other output class and create a single file that can be loaded by the same process and the have a graphics array that index number changes to do the animation
-just an idea
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I have done kind of what you describe before. The first part ( collecting several GIFs into one large gif ) I always did by hand. I then loaded the "image-strip" into my applet and used a PixelGrabber and MemoryImageSources to chop the image-strip into individual images. This is a really good technique to use in Applets because the applet only needs to download one big graphics file from the server. This is much faster than downloading tons of small graphics because the Applet must make a new connection to the server for each request. This method also works well for arcade games, because you can have multiple image strips for each character( for example, one for walking left, one for walking right, one for jumping, etc. ) and stick them all together and have all the graphics for each character in the same place. They are also easy to access in the program, just make a 2-dimensional array to hold all the images.

The new twist on this idea actually sounds like it could be an improvement on the method I have been using. By processing the GIFs into Java Images beforehand, you would cut down on the early processing to load and cut the image-stip into frames. I will have to check this out and see if it works!

-Nate
 
hennie louw
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your view on my idea nathan, i'll send you a copy of my code when i'm finnished. That way you can better on it and teach me more effective coding
Originally posted by Nathan Pruett:
Actually, I have done kind of what you describe before. The first part ( collecting several GIFs into one large gif ) I always did by hand. I then loaded the "image-strip" into my applet and used a PixelGrabber and MemoryImageSources to chop the image-strip into individual images. This is a really good technique to use in Applets because the applet only needs to download one big graphics file from the server. This is much faster than downloading tons of small graphics because the Applet must make a new connection to the server for each request. This method also works well for arcade games, because you can have multiple image strips for each character( for example, one for walking left, one for walking right, one for jumping, etc. ) and stick them all together and have all the graphics for each character in the same place. They are also easy to access in the program, just make a 2-dimensional array to hold all the images.

The new twist on this idea actually sounds like it could be an improvement on the method I have been using. By processing the GIFs into Java Images beforehand, you would cut down on the early processing to load and cut the image-stip into frames. I will have to check this out and see if it works!

-Nate

 
Gnome986
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can u give me a copy of sample code about what you said?
email:aspphp@fm365.com
thanks very much
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!