WEB开发网
开发学院WEB开发Jsp 如何将form保存到图片中! 阅读

如何将form保存到图片中!

 2008-01-05 09:16:13 来源:WEB开发网   
核心提示:public void OnSaveJPG() {Rectangle rect = getBounds();BufferedImage image = (BufferedImage)createImage(rect.width, rect.height);Graphics g = image.getGraphics()

  public void OnSaveJPG() {
Rectangle rect = getBounds();
BufferedImage image =
(BufferedImage)createImage(rect.width, rect.height);
Graphics g = image.getGraphics();
paint(g);
g.dispose();

try {
FileOutputStream fileStream =
new FileOutputStream("E:\Test.jpg");
JPEGImageEncoder encoder =
JPEGCodec.createJPEGEncoder(fileStream);
encoder.encode(image);
fileStream.close();
} catch (Exception e) {
System.out.PRintln("Error saving JPEG file!");
}
}

Tags:如何 form 保存

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接