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

x
?
Solved

Efficient way to create images

Posted on 2002-07-05
7
Medium Priority
?
222 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 1200 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

660 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