Solved

Efficient way to create images

Posted on 2002-07-05
7
217 Views
Last Modified: 2010-03-31
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
Comment
Question by:terjeg
[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
7 Comments
 
LVL 16

Accepted Solution

by:
heyhey_ earned 300 total points
ID: 7132087
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
 
LVL 16

Expert Comment

by:heyhey_
ID: 7132093
to create ofscreen Image use

Image offScreenImage = createImage(500, 500);

to render inside it
offScreenImage.getGraphics().drawImage(image1, 0, 0, null);
0
 
LVL 92

Expert Comment

by:objects
ID: 7133067
> 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 3

Expert Comment

by:yasser_helmy
ID: 7134849
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
 
LVL 35

Expert Comment

by:girionis
ID: 8894024
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
 
LVL 92

Expert Comment

by:objects
ID: 8897937
including the images in the jar seems a lot simpler :)
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

626 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