• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

saving transformed images

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Ethan Gur
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic