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 Lars Eirik Rønning <la...@gmail.com> on 2008/05/30 15:06:54 UTC
SVG / batik helper class for positioning
Does batik offer any helper methods which allow me to insert an image inside
a <symbol reference> and have this take up the entire space of the
container?
I have a symbol element which contains a rectangle which act as a
placeholder.
This rectangle should be removed runtime and be replaces by an image.
The problem is that this rectangle is a vector shape and therefore lots of
transformation has been added from Illustrator.
The use element which references the symbol has x and y values which are
relative to the viewBox, but the problem is that this viewBox should be
altered because i now want to insert a raster image instead of this
rectangle.
As far as I see i have to remove the viewBox and do this calculation my self
in order have the new image take up the amount of space defined by the
rectangle.
What i was hoping for was something that would allow me to switch an element
with another and have this fill up the entire container.
I hope you understand me.
Thanks!
Re: SVG / batik helper class for positioning
Posted by Rob Davis-5 <te...@robertjdavis.co.uk>.
titten wrote:
>
> The problem is that this rectangle is a vector shape and therefore lots of
> transformation has been added from Illustrator.
>
If you need the absolute co-ordinates of the shape in terms of the entire
document then there are batik methods to obtain this. Also, search this
forum for "transform" and you should see some alternative methods for
calculating an elements actual co-ordinates in terms of the entire document
it is within.
Once you've got this you can reference your bitmap image using the SVG
<image> element, supplying the co-ordinates obtained from the calculation
for x,y, and size x and size y.
--
View this message in context: http://www.nabble.com/SVG---batik-helper-class-for-positioning-tp17558465p17775576.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