Re: Using ImageObserver instead of MediaTracker



On Mon, 15 Aug 2005 21:55:39 -0700, Knute Johnson wrote:
> Andrew Thompson wrote:
>>
>> [1] If there is more that one image, it makes more sense to
>> - Instantiate *every* Image (Images load asynchronously)..
>> - Add *every* image to the MediaTracker before you, ..
>> - MediaTracker.waitForAll()
...
> Why Andrew? I think that MediaTracker has become sort of a Java Urban
> Legend. The ImageObserver interface works just fine and you can load as
> many images as you want with that method.

OK. I'll presume you are right on that[1].

I was pretty much saying that the method the OP used
was inefficient, *presuming* they were going to stick
with the MediaTracker.

My reasoning was simply that it would be faster to add
all images to the MediaTracker before calling any of
the 'wait()' methods.

[1] I have no reason to doubt you, you have far more
experience with images than me.

> ..With
> MediaTracker you change the normal behavior of loading asynchronously
> and force them to load synchronously. For what purpose? Use the
> ImageObserver and the images paint when they are available.

Having said that.. Perhaps it was a bad idea to focus on the
MediaTracker at all, especially since I do not think we ever
heard the OP say that an ImageObserver implementation was not
readily available within the ..what is it you were coding?

[ I think I've lost the thread! :-O ]

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"You can blow out a candle, but you can't blow out a fire. Once the flame
begin to catch, the wind will blow it higher." Peter Gabriel 'Biko'
.



Relevant Pages

  • Re: Using ImageObserver instead of MediaTracker
    ... The ImageObserver interface works just fine and you can load as many images as you want with that method. ... With MediaTracker you change the normal behavior of loading asynchronously and force them to load synchronously. ...
    (comp.lang.java.help)
  • Re: Trying to put a background image in a JFrame
    ... all I get is a tiny square off the window bounds. ... to fix that is to use a MediaTracker. ... good examples of loading and displaying images, ...
    (comp.lang.java.gui)
  • merging images
    ... hi can any body sugest me that how can we meerge two images and display ... the result as a single image..although i know that mediatracker, ... graphics class are to be used but how to integerate them together ...
    (comp.lang.java.help)
  • merging images
    ... hi can any body sugest me that how can we meerge two images and display ... the result as a single image..although i know that mediatracker, ... graphics class are to be used but how to integerate them together ...
    (comp.lang.java.help)