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