>Can someone give me sample code on how to control zoom in and zoom out. I
>have added svg file on applet and now with the help of two buttons I want to
>control the zooming feature.
I just researched this issue and found that it caused me severe
I could zoom in or out, but would lose the pan position when
Or I could pan with four arrow buttons (don't want to use the
zoom/pan interactors), but then my zoom factor would be lost.
Don't ask me why it must be so complicated (and why the Batik
Javadoc never gives any code snippets), but the solution is to
combine two AffineTransform objects.
Below is the complete code for one of my six buttons (zoom in,
zoom out, pan left, pan right, pan up, pan down). Pay attention
to the line before I hand the affine transform to the canvas:
here the scale transform and the pan transform are combined.
If you need zoom only, or pan only, you can work with one
of the two AffineTransforms.