mer
asked on
JPG-Decompression in Java
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
You can also read the jpeg image file as byte stream, send it to the applet, applet uses Toolkit.getDefaultToolkit( ).createIm age(byte[] imagedata) method to create the Image back and display
The createImage method understands the byte array format to be either gif or jpeg and handles appropriately