skipping the file

4 views
Skip to first unread message

Isaac4given

unread,
Aug 27, 2007, 3:38:58 PM8/27/07
to WITL (Walk In The Light)
Here is finally part of the source code to take a screen shot and
email it without saving it to a file and reading it back in again
(JavaMail is not required, either):

ByteArrayOutputStream data = new ByteArrayOutputStream();
//...
if (s.equals("{data}")) {
ImageIO.write(new Robot().createScreenCapture(new Rectangle(
Toolkit.getDefaultToolkit().getScreenSize())), "png",
data);
data.flush();
MIMEBase64.write(data.toByteArray());
}
// ...
public static void write(byte[] b) {
int n = b.length;
if (n < 3) {
return;
}
try {
// ...

Here is the full source code:

http://groups.google.com/group/witl/web/OneTime2.java

What do you think?

Reply all
Reply to author
Forward
0 new messages