I'm using awt for rotating images that are kept in DB blobs. The problem is that when I saved the rotated image to the DB, it appears as if its raster has the wrong dimentions. The visual affect of this problem is that the image is cut on its wide side, and a black area is added to its narrow side. This is as if after the rotation - the raster turns to a square.
Thanks Craig - this is the first example that actually works. However - I still have problems with the rotated image - it seems as if it is rotated around the wrong anchor - I still get the black additions on one side of the image, and it is cut on the other side.
I used either this code:
or this one:
but I still could not create the rotated instance correct...
Joined: Feb 17, 2005
Another thing I wanted to state is that I don't use a container - these images are sent to the web via JSF - this means I had to change your example to remove the panel, and simply work with the byte array.