Hi Darren,
(Even though you found a more direct way of solving your problem, I
wanted to respond to some of the points and questions made in this
thread...)
> first, the application hangs at the DOS prompt and never completes
> although the final println _does_ happen.
Whenever you use the AWT (including Graphics objects as part of the
AWT), then the Toolkit starts threads that currently are not daemons
and have no clear way of knowing when they should shut down. There
is a bug filed against this - 4030718.
> Can you point me to a simple code example for MediaTracker?
There is a simple example in the class comments for the class.
> I think my problem might be that the input image is not initially
> loaded by the time I'm doing the drawImage() so I'm drawing nothing
> into the Graphics2D object.
That is exactly the problem.
> As far as I can remember, the MediaTracker can take a NULL component if
> not you can always build a usless component and pass it there, I think
> this works too :-).
It needs a non-Null Component reference, though an empty subclass of
Component will do (as someone pointed out). Note, though, that this
will trigger the "never exit" bug cited above. Also note that using
drawImage() on a Graphics object will also have the drawback of triggering
4030718.
> The component parameter is only require so the Media
> can informe the component that the image has been "updated"
The specific reason that the component is needed is so that the MediaTracker
can invoke the "prepareImage()" method on it which triggers image loading
without actually drawing it anywhere. The MediaTracker uses its own
ImageObserver objects to track the updates to the image.
> > g.drawImage(scaled_image, null, null);
>
> Here's your problem. I'm not sure why you're trying to use a null kernel op
That code snippet isn't using an "op" at all. It is using a null
AffineTransform along with a null Observer. The reason the result
was all black was due to not waiting for the image to load...
...jim
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".