BufferedImage img = ImageIO.read(new File(paramString));
double locationX = img.getWidth(this)/2;
double locationY = img.getHeight(this)/2;
AffineTransform tx = AffineTransform.getRotateInstance(Math.toRadians(paramInt3), locationX, locationY);
AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);
BufferedImage bimg = new BufferedImage (img.getWidth(this), img.getWidth(this), BufferedImage.TYPE_BYTE_INDEXED);
bimg = op.filter (img, null);
ImageIcon localImageIcon = new ImageIcon (bimg);
为什么会一边被切断? 我正在使用一个需要最终结果为ImageIcon的库。
问题在哪里? – jhamon
我的代码旋转图像,但顶部和左侧的角落被切断 – ogprogrammingsquad