Hi there
Do this

tmp2 = new byte[128];
DataBuffer db = new DataBufferByte(tmp2,tmp2.length);
WritableRaster raster = 
WritableRaster.createInterleavedRaster(db,width,height,width,1,new int[]{0},null);
ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);
ComponentColorModel cm = new ComponentColorModel(cs,new 
int[]{8},false,false,Transparency.OPAQUE,DataBuffer.TYPE_BYTE);
BufferedImage img = new BufferedImage(cm, raster,true,null);

This will create an grayscale image
/Markus

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