Hi All,

I am trying to export Zoomed In SVGDocument to JPEG file. But after exported
as JPEG, it doesn?t have same size, which is in SVGCanvas. I am setting
KEY_WIDTH and KEY_HEIGHT transcoding hint values calculated using following
code. 

GraphicsNode gNode = getGraphicsNode();
Rectangle2D viewRect = (Rectangle2D)gNode.getBounds().clone();
AffineTransform vCoordi = getViewBoxTransform();
final Rectangle docSize = vCoordi.createTransformedShape(new Rectangle(0, 0,    
      
(int)viewRect.getWidth(), (int)viewRect.getHeight())).getBounds();
.
.
.
JPEGTranscoder t = new JPEGTranscoder();
t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(1));
t.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, new
Float((float)docSize.getWidth()));
t.addTranscodingHint(JPEGTranscoder.KEY_HEIGHT, new
Float((float)docSize.getHeight()));

In SVGAbstractTranscoder, while calculating the scale value using following
code, it doesn?t return the same scale value of 
?getSVGDocument().getRootElement().getCurrentScale()?.

float xscale, yscale;
xscale = width/docWidth;
yscale = height/docHeight;
float scale = Math.min(xscale,yscale);

Since there is some difference is scale value, it doesn?t export scaled JPEG
file with exact size. Can anyone please explain how to export JPEG file with
exact zoom in size?

Thanks,
Sudhakar
-- 
View this message in context: 
http://www.nabble.com/Mismatch-in-Scale-value-tf1893554.html#a5178516
Sent from the Batik - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to