Hi there,

 The BufferedImage I'm retrieving using Batik looks like its been clipped
(though no clip has been carried out).

 The width, height and AOI params have been set. The Area Of Interest hint
looks like its not being honoured.

 The problem image is at:
 [URL=
http://imageshack.us][IMG]http://img528.imageshack.us/img528/5228/sanfranmapclippedfc6.jpg[/IMG][/URL
]

 Can anyone offer a suggestion as to what the issue is and how to work
around it?

Thanks
 Brian


 /**
  * Generates a java.awt.image.BufferedImage from the GMLImage
  *
  * @return  A BufferedImage Object decoded from the GMLImage
  */
 public BufferedImage getBufferedImage
 (
 )
   {

   MyImageTranscoder t = new MyImageTranscoder();
   t.addTranscodingHint(SVGAbstractTranscoder.KEY_WIDTH, new Float(width));
   t.addTranscodingHint(SVGAbstractTranscoder.KEY_HEIGHT, new
Float(height));
   t.addTranscodingHint(SVGAbstractTranscoder.KEY_AOI, new Rectangle( 0, 0,
width, height ) );

   //"store" bytearray containig the image data.
   TranscoderInput input = new TranscoderInput( new ByteArrayInputStream(
store ) );

   t.transcode( input, null );

   return t.getBufferedImage();
   }

 class MyImageTranscoder
   extends PNGTranscoder
   {
   protected BufferedImage img;

   public void writeImage
   (
   BufferedImage image,
   TranscoderOutput output
   )
   throws TranscoderException
     {
     this.img = image;

     }

   public BufferedImage getBufferedImage ()
     {
       TranscodingHints hints = this.getTranscodingHints();

       Float fWidth = (Float) hints.get(SVGAbstractTranscoder.KEY_WIDTH);
       Float fHeight = (Float) hints.get(SVGAbstractTranscoder.KEY_HEIGHT);
       this.setImageSize(fWidth.floatValue(), fHeight.floatValue());

     return img;
     }
   }

Reply via email to