Solved

JPG-Decompression in Java

Posted on 1998-06-05
4
243 Views
Last Modified: 2010-05-18
Hello

I want to send JPG-Pictures with a Socket-Stream to an Applet!! (Byte-Arrays)

But I have no Idea, how I can decode the Picture in Memory.

thanx for help

:-)
      Dennis

Please help
0
Comment
Question by:mer
  • 3
4 Comments
 
LVL 5

Accepted Solution

by:
fontaine earned 100 total points
ID: 1222199
I think you have here what yu need:

http://lcavwww.epfl.ch/demos/jpeg.html
0
 
LVL 4

Expert Comment

by:evijay
ID: 1222200
You draw the image on an offscreen canvas which you create on the server side (program which uses ServerSocket), use pixelgrabber class to get the bytes of the image, send the image to applet. In the applet side, use MemoryImageSource to construct back the Image from array of bytes and display the image where ever you want.
0
 
LVL 4

Expert Comment

by:evijay
ID: 1222201
You can also read the jpeg image file as byte stream, send it to the applet, applet uses Toolkit.getDefaultToolkit().createImage(byte[] imagedata) method to create the Image back and display

0
 
LVL 4

Expert Comment

by:evijay
ID: 1222202
The createImage method understands the byte array format to be either gif or jpeg and handles appropriately

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jar file executable 12 58
Windows 10 IE Certificate Issue 10 51
Facing this issue for maven proxy setting 2 20
American Express @Work site and Java 4 17
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question