这就是你可以做到的。这段代码假设存在一个名为“ image”的缓冲图像(如你的评论所说)
// The required drawing locationint drawLocationX = 300;int drawLocationY = 300;// Rotation informationdouble rotationRequired = Math.toRadians (45);double locationX = image.getWidth() / 2;double locationY = image.getHeight() / 2;AffineTransform tx = AffineTransform.getRotateInstance(rotationRequired, locationX, locationY);AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);// Drawing the rotated image at the required drawing locationsg2d.drawImage(op.filter(image, null), drawLocationX, drawLocationY, null);



