Jakość obrazu zostaje zrujnowana w Java Graphics2D Rotate
Mam problem z obracaniem obrazu za pomocą metody obracania Graphics2D.
Oto obraz problemu, który mam:
Przesuwając piłkę, obraz ulega całkowitemu zniekształceniu, gdy się obraca.
Oto moja metoda rotacji:
public static void rotate(BufferedImage img, Rectangle rect, int degrees) {
Graphics2D g = (Graphics2D) img.createGraphics();
g.rotate(degrees, rect.x + rect.width/2, rect.y + rect.height/2);
g.drawImage(img, rect.x, rect.y, rect.width, rect.height, null);
g.dispose();
}
Czy jest coś, co mogę zrobić, aby uniknąć utraty jakości?