我只想放大BufferedImage
并在上面加上水印。这是我的代码。
BufferedImage image = GetHtmlImage(doc, base_url, width, -1);
if (image.getHeight() < MaxShortHeight) {
return "";
}
BufferedImage gimage = new BufferedImage(image.getWidth(), image.getHeight() + 20, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = gimage.createGraphics();
g2.setBackground(Color.WHITE);
g2.drawImage(image, BufferedImageOp, 0, 0);
g2.setColor(Color.BLACK);
g2.drawString("Press by Shisoft WebFusion http://www.shisoft.net/", 10, image.getHeight() - 10);
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(gimage, "jpeg", os);
在'g2.drawImage(image,BufferedImageOp,0,0);'。我不知道什么是BufferedImageOp
。有人可以举个例子。
谢谢。