我只是想放大一个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
。有人可以举个例子吗?
谢谢你。