xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Helder Magalhães <helder.magalh...@gmail.com>
Subject Re: prob affinetransformation and bound
Date Mon, 05 Apr 2010 16:46:01 GMT
Hi heran,

> i have a svg picture which is rendering in a graphic greater document.
> i get the graphicsnode from my builder
> i do translation and a scale up upon it.
> the i make a bufferizedimage (java) to draw it.
> result :
> i see the svg but partially !
> the svg itself is well resized (now greater) but the bounds (getBounds) is
> always the same so my svg is not completely visible because bounds seems not
> to be resized !
> it is like you consult this picture throw a small invisible window ! or like
> the center of this new svg is just draw !
> can you help me ? teaching me what is wrong or with an example code ?
> i have noticed also : if i use getTransformedBounds() to retrieve x,y for ma
> bufferedimage instead getbounds(), i have a new bounds but when i draw the
> svg, it is "deformed" and it seems an unknown translation has been
> applicated !

My guess is that there's some kind of unexpected values in the source
graphic regarding either 'width'/'height'/'viewBox' [1] attributes
versus the 'preserveAspectRatio' [2] attribute, all of them applicable
to the 'svg' element. Note that, when I mean "unexpected" values I
mean that the behavior can be less intuitive, although completely
valid according to the standard! :-)

Also, as Thomas has stated, an example with a simple code snippet
would help better illustrate the situation... ;-)

Hope this helps,

[1] http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute
[2] http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute

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

View raw message