xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sudhakar S <yessudha...@hotmail.com>
Subject Re: Export jpeg/tif/png saves only visible area of the image
Date Wed, 10 May 2006 14:08:29 GMT

Hi Thomas,

Now i can able to export jpeg/tif/png based on the width and height i used.
But here i didnt use cloned document. because while using cloned document, i
am getting following exception. i used
"DOMUtilities.deepCloneDocument(svgCanvas.getSVGDocument(), impl)" to clone
the document. But can i use available document instead of cloned document?

java.lang.NullPointerException
        at
org.apache.batik.dom.svg.SVGOMSVGElement.getCurrentScale(SVGOMSVGElement.java:222)
        at
org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:296)
        at
org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:91)
        at
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)
        at
org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:157)
        at
SVGApplication15$ThumbnailDialogAction.actionPerformed(SVGApplication15.java:661)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
Source)

While calculating height and width, it returns wrong coordinates. so i
couldn't save the full scaled image. so can you please explain how to
calculate scaled image size? I used the following way to calculate width and
height.

AffineTransform att = svgCanvas.getRenderingTransform(); 
Rectangle canvasRect = svgCanvas.getBounds(); 
AffineTransform itrans = att.createInverse(); 
Rectangle rect = itrans.createTransformedShape(canvasRect).getBounds(); 
double w = rect.getWidth() * docWidth; 
double h = rect.getHeight() * docHeight; 

thanks,
Sudhakar


--
View this message in context: http://www.nabble.com/Export-jpeg-tif-png-saves-only-visible-area-of-the-image-t1589363.html#a4320299
Sent from the Batik - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message