funnyveryfunny
asked on
Applet.getImage() faster alternative
Hello,
Is there any faster method than Applet.getImage()?
I'm writing an applet that displays images like a gallery, but I find Applet.getImage() a bit slow. Each of my image is about 100k or (800x600) so I know it will take time. But it is relatively slower than the speed of a Browser.
Size of image is important for quality wise, so is there any other way? Thought about using BufferedReader to read in stream then construct the image, would this be faster?
Thanks.
Is there any faster method than Applet.getImage()?
I'm writing an applet that displays images like a gallery, but I find Applet.getImage() a bit slow. Each of my image is about 100k or (800x600) so I know it will take time. But it is relatively slower than the speed of a Browser.
Size of image is important for quality wise, so is there any other way? Thought about using BufferedReader to read in stream then construct the image, would this be faster?
Thanks.
add your images to a jar and load them from there
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanx but my Image list is growing all the time so this would not be ideal.
ASKER
I'm reading Javadoc on ImageInputStream and ImageIO, would this be any good?
i doubt they'd make any difference.
ASKER
ImageIO provides a read() that returns BufferedImage which is fine but does it improve on speed?
ASKER
oh wise one, in your experience what shall I do?
Stick with Applet.getImage() and hope that user doesn't mind.
Use filecache?
Stick with Applet.getImage() and hope that user doesn't mind.
Use filecache?
Hi funnyveryfunny,
I'm assuming that you're creating an image viewer applet to show pictures from an album.
I am not sure that there are any metrics available for image loading times using the various I/O sources vs. getImage(). I would recommend that you measure and see how it goes.
\t
I'm assuming that you're creating an image viewer applet to show pictures from an album.
I am not sure that there are any metrics available for image loading times using the various I/O sources vs. getImage(). I would recommend that you measure and see how it goes.
\t
> ImageIO provides a read() that returns BufferedImage which is fine but does it improve on speed?
I doubt it, its probably using thew same mechanism to perform the download.
I doubt it, its probably using thew same mechanism to perform the download.
ASKER
Thanx orangehead911,
I'm looking into how I can retrieve Image metric data to display in JProgress bar while its loading.
Can you shed some lights?
I'm looking into how I can retrieve Image metric data to display in JProgress bar while its loading.
Can you shed some lights?
ASKER
looks like I have to give up on that.
Now the least I can do for the poor viewers is to indicate some progress while they sat there wondering what's going on here? So how do show image loading progress using JProgressBar.
Now the least I can do for the poor viewers is to indicate some progress while they sat there wondering what's going on here? So how do show image loading progress using JProgressBar.
> thanx but my Image list is growing all the time so this would not be ideal.
you could rebuild your jar when your image list changed.
you could rebuild your jar when your image list changed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanx Objects, I gave up on the idea of "speedy gonzalez" :-(
What about image loading progress? please advice.
What about image loading progress? please advice.
ASKER
I'll look at the links now.
Thanx.
Thanx.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanx Ovi, at the moment I'm intending to place the applet with www.geocities.com free service but in the future this could be any where so I dont want it as a server-dependent program.
I have tested the image loading progress using IIOReadProgressListener, although the documentation is not very specific I managed to implement a console version therefore give me a bit of time before I finalise this question.
In the mean time, thank you.
I have tested the image loading progress using IIOReadProgressListener, although the documentation is not very specific I managed to implement a console version therefore give me a bit of time before I finalise this question.
In the mean time, thank you.
... you can try anyway with the multiple threads option. Usually all servers are upgraded to use the latest http protocol ....
And if the server is not using it, you can just use a single thread model to download. If your implementation is general enough, the applet will be capable of behaving in different ways, depending on the situation.
And if the server is not using it, you can just use a single thread model to download. If your implementation is general enough, the applet will be capable of behaving in different ways, depending on the situation.
ASKER
Ovi, something for the future.
I decided to use ImageIO and ImageReader methods, cut down loading time by approx half.
thank you all.
I decided to use ImageIO and ImageReader methods, cut down loading time by approx half.
thank you all.
=-)
That's cool. Thank you :)