Hello,
I wrote code to rotate BMP images, and it works very good with square images. But it doesn't work with rectangular ones. When I try to rotate them, I obtain an images with all pixels in a wrong position, so that it is impossible to understand the content... WHY ??
thank you
//BufferedImage toStore
BufferedImage toStore = new BufferedImage(Width,Height,BufferedImage.TYPE_INT_RGB );
Graphics2D g2d =toStore.createGraphics();
//double centerX = (Height - Width)/2.0;
//double centerY = (Width - Height)/2.0;
double centerX = Width/2.0;
double centerY = Height/2.0;
AffineTransform rotationTransform = new AffineTransform();
rotationTransform.rotate(Math.toRadians(Degrees), Width/2.0, Height/2.0);
// draw the image using the AffineTransform
g2d.drawImage(img, rotationTransform, null);