Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

saving transformed images

 
Ethan Gur
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

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.

Here is a snippet from the code:


Can anyone help please?
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Ethan Gur
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Ethan Gur
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic