[2678] in java-interest
Re: Async image loading
daemon@ATHENA.MIT.EDU (julie melbin)
Tue Oct 10 09:39:33 1995
Date: Tue, 10 Oct 95 07:18:47 EDT
To: java-interest-digest@java.sun.com
From: julie melbin <julie@world.std.com>
Hi everyone
I've some comments that I don't think are unique regarding the JDK API
image changes. Note that the previous beta allowed you to have 1 thread
'block' while fetching an image, which let you easily schedule other tasks
within your applet as you saw fit. Some applets (ours of course) much
prefers to read in some small number of images first (in the background) and
be able to render them as needed.
We appreciate the posting of the media tracker example but I still find it
odd that the image must be rendered to be fetched. Isn't this an excessive
use of resources? I'm guessing this is the best alternative, being as it
comes from inside Sun, but I still long for the previous beta's behavior and
functionality.
Thanks for your time
julie
>
>From: flar@bendenweyr.Eng.Sun.COM (Jim Graham)
>Date: Mon, 9 Oct 1995 14:41:49 -0700
>Subject: Re: Beta API and synchronous image loading
>
>> Does anyone have an idea on how to force preload of the images so that I
>> can ensure the data is present (and so that .width() and .height() values
>> are guaranteed to work!)
>
>First, I would like to point everyone to the prebeta1 image porting guide:
>
> http://www.javasoft.com/JDK-prebeta1/converting/images.html
>
>To answer your specific question, you can use a class which implements
>the ImageObserver interface to track the state of images as they load.
>Unfortunately, you have to render the image at least once so that the
>system knows which images and at what sizes you want the images scaled
>before they will be downloaded. You also may have to deal with tracking
>multiple images which can get cumbersome.
>
>To help deal with this, I have written a utility class called the
>MediaTracker. I have a pointer to it and its documentation off of
>my home page:
>
> http://www.javasoft.com/people/flar/
>
>Feel free to download it and use it with your applets. We are working
>on adding it officially to the Java APIs, but in the meantime the above
>version can be compiled with your applet and will work with the existing
>JDK and netscape 2.0 beta.
>
> ...jim
>
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com