Hi Bhati,
Shekhar Bhati <[email protected]> wrote on 10/14/2009 06:57:26 AM:
> I am using Batik for viewing the images in my application.
> We have a functionality of drag and drop of the objects and when I
> drop the object , document gets reloaded.
Why do you reload the document? If you setup the canvas so it
is dynamic and changes to the document[*] will be reflected automatically
in the canvas.
> If first i zoom the image and then do the drag and drop then the
> document gets reloaded and the image is not zoomed in after reloading.
> My task is to restore the scale/factor and coordinates after
> reloading, so that view gets open on the same place and with same
> zoomed/panned state as it was before dropping.
> Any hints??
The zoom/pan information is stored in the rendering transform.
The canvas has a 'getRenderingTransform()' method to get this. You
can also set it with 'setRenderingTransfom()' the one tricky thing
is that you need to wait for the document to be loaded before you
set the rendering transform or else it will get reset by the loading
process.