Martin Thomas wrote:
> Hi,
>
> simple question and hopefully a simple solution:
> How can i convert an java.awt.Image into a BufferedImage?
If you are lucky, a cast will do. If not, if you really have an unknown
Image subclass, well it's not fun:
* Get the Image's consumer with Image.getSource().
* Use a PixelGrabber to read the image data from the consumer into some
pixel array
* Create a DataBufferInt from the pixel data
* Create a WritableRaster using the DataBufferInt
* Create a BufferedImage using the WritableRaster
* curse, wait, curse, wait, curse, curse, curse
There might be better ways.
/Thomas