How to create jpeg files in java ?

M

Martin M

Hi collegues,

I have two problems:
1.) I am calculating some pixels and show them on the mintor, but there is
no point or pixel class in java to show one pixel on the monitor. My
workaroung is to use Graphics g ; g.setColor(new Color(x,y,z) );
g.drawLine(x,y,1,1);
Are there any more polite ways to draw pixels on the screen ?
and
2)How do I am able to save my picture from screen in to a jpeg-files ?
Where can I get the jpeg saving and imaging (coding/decoding) algorithm ?

Regards,
Martin
 
G

Guest

Hi collegues,

I have two problems:
1.) I am calculating some pixels and show them on the mintor, but there is
no point or pixel class in java to show one pixel on the monitor. My
workaroung is to use Graphics g ; g.setColor(new Color(x,y,z) );
g.drawLine(x,y,1,1);
Are there any more polite ways to draw pixels on the screen ? and
2)How do I am able to save my picture from screen in to a jpeg-files ?
Where can I get the jpeg saving and imaging (coding/decoding) algorithm
?

Regards,
Martin

Do a quick google on java +jpg.

http://www.geocities.com/marcoschmidt.geo/java-image-coding.html

HTH,
La'ie Techie
 
R

Roedy Green

I have two problems:
1.) I am calculating some pixels and show them on the mintor, but there is
no point or pixel class in java to show one pixel on the monitor. My
workaroung is to use Graphics g ; g.setColor(new Color(x,y,z) );
g.drawLine(x,y,1,1);

If you have an Image, there are methods to manipulate it, then use
drawImage in paint or paintComponent. That way you don't have to keep
recomputing all the speckles on every paint.
Are there any more polite ways to draw pixels on the screen ?
and
2)How do I am able to save my picture from screen in to a jpeg-files ?
Where can I get the jpeg saving and imaging (coding/decoding) algorithm ?

see http://mindprod.com/jgloss/jpegencoder.html
 

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
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top