Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

JPG-Decompression in Java

Posted on 1998-06-05
4
Medium Priority
?
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 5

Accepted Solution

by:
fontaine earned 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

730 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