Hi Luca,

your sample application helped me very well. Now the zoom is working, i implemented it on a Buttonclick instead of the mouse-click

           if(cmd.equals("Zoom")){
               AffineTransform at;
               at = canvas.getRenderingTransform();
if(p2d1 != null && p2d2 != null){ at.preConcatenate(AffineTransform.getTranslateInstance(-p2d1.getX(), -p2d1.getY())); at.preConcatenate(AffineTransform.getScaleInstance(1.25, 1.25)); at.preConcatenate(AffineTransform.getTranslateInstance(p2d1.getX(), p2d1.getY()));

                   canvas.setRenderingTransform(at);
                   System.out.println("Zoom-in");
               }

           }

As you can see, i am working with p2d1 and p2d2, these are of the Type Point2D --> coordinates from the Rectangle that the user can drag to choose where to zoom in. But i don't really know how to make it zoom into the choosen Area, and only this area. So it should be zoomed in that exactly this Area can be shown. (The Area the user dragged with his mouse).

I have to say, that my Points (p2d1 and p2d2) i transformed like this:
at = canvas.getViewBoxTransform(); p2d1 = at.transform(new Point2D.Float(pressedX, pressedY), null); p2d2 = at.transform(new Point2D.Float(releasedX, releasedY), null);

As you can see, i have done the ViewBoxTransform at first, to get exactly the Coordinate 0,0 on the top left corner of the SVG-Image.

So, would it be possible to zoom into the choosen Area? I really don't know how to do that

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to