Hi Asvija,
asvija wrote:
I'm new to batik. I want to develop a java application which displays a svg
document. It should also support providing different zoom factors for x and
y scales separately, i.e there may be instances in which the application has
to zoom the svg only in x direction and not in y direction.
Is it possible to do this using batik (JSVGCanvas , I suppose) ?
Yes, there are quite a number of ways to accomplish this. Is
this a static property of the document being rendered or is it
something you want to control from user interaction?
For UI driven stuff you probably want to look at way to manipulate
the RenderingTransform (which is what the zoom action does). For
'static' stuff you probably want to look at either the SVG transform
attribute (which can scale non-uniformly in X & Y), or the viewBox
attribute in combination with the 'preserveAspectRatio' attribute
(set to 'none' to allow non-uniform scaling).
Also, I could not understand how to use ZoomAction in JSVGCanvas. I see that
the ZoomAction has a constructor with x and y zoom factors. But I'm not sure
how to use it. Please can any one tell me how to use this . Or is there any
other way to achieve the same effect of zooming only in one direction. ?
It is a normal Swing Action class. Once you have constructed it you
can use it anywhere you would use a Swing action[1] (bound to a
Menu item, key combination, toolbar button). The details of using
a Swing Action is a bit outside the scope of Batik.
[1]: http://java.sun.com/j2se/1.3/docs/api/index.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]