Thanks Adrienne, but that won't work for me...

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.  I'm running a terminal session.  What I 
really need are the steps for converting an Image object directly to a Raster object 
without the intermediate BufferedImage object.

I have been tinkering with something like the following but I'm at a loss for the 
stuff in the SampleModel / DataBuffer section...

--------------------------
Image input_image = Toolkit.getDefaultToolkit().createImage("c:\\test.jpg");
// SampleModel sm = new SampleModel(datatype?, 640, 480, numbands?);
// DataBuffer db = new DataBuffer(datatype?, size?);
// populate the DataBuffer with the input_image object's pixels?
Raster rst = new Raster(sm, db, new Point(0,0));
-----------------------

Thanks again,
Darren





>>> "Adrienne Slaughter" <[EMAIL PROTECTED]> 01/31/00 05:09PM >>>

Image myImage;
BufferedImage bufImage = new BufferedImage(myImage.getWidth(null),
                                           myImage.getHeight(null),
                                           BufferedImage.TYPE_INT_RGB);
Graphics g = bufImage.getGraphics();
g.drawImage(myImage, 0, 0);
Raster rasterImage = bufImage.getRaster();

===========================================================================
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