> You suggest using the drawImage() method to copy the original Image object
> into the BufferedImage object's Graphics2D context.  Normally that would
> be ok but acording to the API, the Graphics2D.drawImage() method that
> accepts an Image object as input also requires an
> java.awt.image.ImageObserver object - something that's only available if
> you're inside an Applet or GUI application.

This is not quite true.

There is an ImageObserver parameter on the drawImage calls, but it can
be null.  The ImageObserver is registered to receive information on
when more of the image data is ready to be drawn should the image be
incomplete when you draw it (i.e. the data is still being loaded).  If
the data is incomplete when you try to make this conversion then you are
out of luck no matter how you try to convert.

The java.awt.MediaTracker object can help you to make sure that the image
is completely loaded before you do the conversion so that the ImageObserver
is then essentially irrelevant.

Also, anyone can implement the ImageObserver interface.  There is a very
simple implementation baked into the Component class for the convenience
of its sub-classes but that does not mean that you cannot create your own
Observer outside of that class inheritance...

                                ...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".

Reply via email to