Solved

JPG-Decompression in Java

Posted on 1998-06-05
4
228 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How Complex Is This Java Course ? 9 62
Systems talking to each other 5 107
JAVA part two 5 39
mockito example issue 8 30
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now