You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by heran <dr...@yahoo.fr> on 2010/03/24 18:45:17 UTC

prob affinetransformation and bound

Hello all,
im new batik use and after some searches, i always have the following
problem :
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 !
-- 
View this message in context: http://old.nabble.com/prob-affinetransformation-and-bound-tp28018809p28018809.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: prob affinetransformation and bound

Posted by Helder Magalhães <he...@gmail.com>.
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,
 Helder


[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


Re: prob affinetransformation and bound

Posted by th...@kodak.com.
Hi Heran,

heran <dr...@yahoo.fr> wrote on 03/24/2010 01:45:17 PM:

> 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 !

    The bounds of an element are always reported in the local coordinate
system of the element.  If you want to know what the bounds of the element
are in another coordinate system you need to transform them to the other
coordinate system.

> 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 !

   I don't understand this part of your note.  Perhaps examples on your
part would help?