• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Efficient way to create images

Hi,

I'm making a Java applet that is used for image viewing. When the user clicks on the applet, the next image (in a jar-file) is displayed. Since I want to reduce download times. On some images the difference from the previous image is small and I have created an application that scans the images and only publishes the changes from the previous image.
In the paint routine, (lets say for picture 5), I paint Image1, Image2 etc.
It's obvious that when you are at the end of a long sequence, the painting of the next image takes forewer. Anyone that has any suggestions on how to quicly assemble the images. (Note it must also be possible to go backwards in the applet.)
0
terjeg
Asked:
terjeg
1 Solution
 
heyhey_Commented:
you can render all "passed" images inside offscreen image - and inside your paint() method, you will have to render only one image (the offscreen one).
0
 
heyhey_Commented:
to create ofscreen Image use

Image offScreenImage = createImage(500, 500);

to render inside it
offScreenImage.getGraphics().drawImage(image1, 0, 0, null);
0
 
objectsCommented:
> the next image (in a jar-file) is displayed.
> Since I want to reduce download times

Are all these images in the one jar file or in seperate jars?
If they are all in one then they'll all be downloaded in one and available on the client so their won't be any download delay between images.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
yasser_helmyCommented:
You have to download the images. However, when the jar file is downloaded, all the images packed inside it are also downloaded. So showing the first images takes time to download, but all other images in the jar dont download. Even if the images are packed inside multiple jars, you will spend time downloading the jars once and then you dont have to spend more time viewibg images.
You need to download the jars when loading the applet so you dont get delays between images.
I hope this helps.
0
 
girionisCommented:
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- points to heyhey_

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0
 
objectsCommented:
including the images in the jar seems a lot simpler :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now