Sto provando a ruotare l'immagine. Sto usando questo codice Java:Java - Rotazione immagine
BufferedImage oldImage = ImageIO.read(new FileInputStream("C:\\workspace\\test\\src\\10.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\\10_.JPG"));
Ma vedo strano risultato:
Fonte:
Risultato:
**Result image:** http://s14.postimage.org/cjut935ip/image.jpg
potete per favore aiutare io con questo problema?
Non dovresti ruotare attorno al centro di oldImage, piuttosto che newImage? –
Io provo graphics.rotate (Math.toRadians (90), oldImage.getWidth()/2, oldImage.getHeight()/2); Non è d'aiuto. http://s13.postimage.org/7omxa1oef/image.jpg – user1631241