Java - Rotation De L'Image

Je suis en train de faire tourner l'image. Je suis en utilisant ce code Java:

BufferedImage oldImage = ImageIO.read(new FileInputStream("C:\\workspace\\test\\src\.JPG"));
BufferedImage newImage = new BufferedImage(oldImage.getHeight(), oldImage.getWidth(), oldImage.getType());
Graphics2D graphics = (Graphics2D) newImage.getGraphics();
graphics.rotate(Math.toRadians(90), newImage.getWidth() / 2, newImage.getHeight() / 2);
graphics.drawImage(oldImage, 0, 0, oldImage.getWidth(), oldImage.getHeight(), null);
ImageIO.write(newImage, "JPG", new FileOutputStream("C:\\workspace\\test\\src\_.JPG"));

Mais je vois résultat étrange:

Source:

Java - Rotation De L'Image

Résultat:

**Le résultat de l'image:** http://s14.postimage.org/cjut935ip/image.jpg

Pouvez vous s'il vous plaît m'aider avec ce problème?

Ne devriez-vous pas tourner autour du centre de oldImage, plutôt que de newImage?
J'essaie de graphiques.tourner(en Mathématiques.toRadians(90), oldImage.getWidth() / 2, oldImage.getHeight() / 2); Sa aide pas. s13.postimage.org/7omxa1oef/image.jpg

OriginalL'auteur user1631241 | 2012-08-28