public void OnSaveJPG() {
Rectangle rect = getBounds();
BufferedImage image =
(BufferedImage)createImage(rect
Graphics g = image
paint(g);
g
try {
FileOutputStream fileStream =
new FileOutputStream(
JPEGImageEncoder encoder =
JPEGCodec
encoder
fileStream
} catch (Exception e) {
System
}
}
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19655.html