F
Francois Lionet
Hello,
I have an Image, and I would like to get the same image, rotated.
I know I have to use the AffineTransformOp class to do the job. But the
problem is that this class only works with Graphics2D. I cannot find a way
to transform an image directly.
So, in fact I should : a) create a BufferedImage from my Image (which is not
simple, I have to create a buffered image, then get the graphics2d then draw
the image in it), b) create an compatible dest bufferedimage using
affinetransformop.createcompatibleDestImage, c) get a graphics2d on this
image, d) perform the rotation in the graphics2d. Pfwew. Long winded road
isn't it? Isn't there a better way of doing this?
If anyone has a direct method, please tell me!
Thanks, Francois
I have an Image, and I would like to get the same image, rotated.
I know I have to use the AffineTransformOp class to do the job. But the
problem is that this class only works with Graphics2D. I cannot find a way
to transform an image directly.
So, in fact I should : a) create a BufferedImage from my Image (which is not
simple, I have to create a buffered image, then get the graphics2d then draw
the image in it), b) create an compatible dest bufferedimage using
affinetransformop.createcompatibleDestImage, c) get a graphics2d on this
image, d) perform the rotation in the graphics2d. Pfwew. Long winded road
isn't it? Isn't there a better way of doing this?
If anyone has a direct method, please tell me!
Thanks, Francois