GIFEncoder

S

shameram

Hello...
I am working on an image splitter program, which splits the image into
number of segments decided by the user.
Till now I create a vector where each element is an array that holds
the pixels of the image's segment.
Well, I am working with GIf Images. I found a GIFEncoder, but I dont
know how to use it correctly to display the images that I have in the
vector as array of pixels.

actually the GIFEncoder that I'm trying to use is on this site:
http://www.acme.com/java/software/Acme.JPM.Encoders.GifEncoder.html

thanx in advance
Shameram Sadaki
 
O

Oliver Wong

shameram said:
Hello...
I am working on an image splitter program, which splits the image into
number of segments decided by the user.
Till now I create a vector where each element is an array that holds
the pixels of the image's segment.
Well, I am working with GIf Images. I found a GIFEncoder, but I dont
know how to use it correctly to display the images that I have in the
vector as array of pixels.

actually the GIFEncoder that I'm trying to use is on this site:
http://www.acme.com/java/software/Acme.JPM.Encoders.GifEncoder.html

From the JavaDocs, you pass the GifEncoder an Image or an ImageProducer,
and an OutputStream.

So convert whatever you have to an Image or an ImageProducer, and pass
it a FileOutputStream if you want the GIF to be written to a file, for
example.

- Oliver
 
S

shameram

Oliver said:
From the JavaDocs, you pass the GifEncoder an Image or an ImageProducer,
and an OutputStream.

So convert whatever you have to an Image or an ImageProducer, and pass
it a FileOutputStream if you want the GIF to be written to a file, for
example.

- Oliver

Well I passed the Image to the constructor, but after using the
constructor should I call the method write(OuputStream output)? and if
I should the output file that i will pass it will be null?

Shameram
 
T

Thomas Fritsch

shameram said:
Well I passed the Image to the constructor, but after using the
constructor should I call the method write(OuputStream output)? and if
I should the output file that i will pass it will be null?
Did you also read the API doc of GifEncoder's superclass, ImageEncoder?
Look especially at its 'encode' method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top