Hello
 
I'm writing applet viewing SVG using batik 1.5.1. I need to write a 
function witch will zoom SVG document on SVGCanvas object to desier 
SVG coordinates, or return AffineTransform  object witch I can use to 
transform orginal SVG view to desire area. For example: my svg 
viewbox is: 0 0 200 200, 
and I want to zoom to: upperLeftX = 50, upperLeftY = 50, 
bottomRightX = 100, bottomRightY = 100
 
Function schould look like this. 
// upperLeft - upper left x,y SVG coordinates 
// bottomRight - bottom right x,y SVG coordinates
// This two pair of coordinates is desier view SVGCanvas should zoom 
to. 
private AffineTransform setZoom(Point2D upperLeft, Point2D 
bottomRight) {
 
 
// funtion body 
 
}
 
I know that AffineTransform uses screen coordinates to zoom SVG 
document on SVGCanvas. What I realy need is to know how to convert 
SVG coordinates to screen coordinates. 
 
Could You send me any sugestions?
 
Thanks a lot
 
Bartosz Celmer

 

Reply via email to