All pastes #255268 Raw Edit

Miscellany

public text v1 · immutable
#255268 ·published 2006-11-22 20:01 UTC
rendered paste body
		Rectangle rec = new Rectangle(w,h);
		BufferedImage a = r.createScreenCapture(rec);
		
		//Serialize
		ByteArrayOutputStream bos = new ByteArrayOutputStream();;
		try {
        ObjectOutput o = new ObjectOutputStream(bos) ;
        o.writeObject((Object) a);
        o.close();
		} catch (IOException e) {}
		
		byte[] serial = bos.toByteArray();
		
		
		try{
		out.writeObject(serial.length);
		for(int i = 0; i < serial.length; i++)
			out.writeObject(serial[i]);
		out.writeObject("picture sent");
		}catch(IOException e){}ption e){}