Problem with zoom


#1

i am writing a small program which zooms the images that r displayed in the view. i am using svg images. when i try to zoom using the JGoView.setScale() i get a blurred image, some stair cases are formed as it happends when zooming an image. so after setting the scale, i got the new dimensions of each image, converted each image into an svg, and then back to a buffered image so as to remove the stair cases. but the problem remained. is the problem with the view graphics ? can anybody help me out.


#2

What you are describing (re-rasterizing the image if the scale factor changes) should work. Perhaps a repaint using the new re-rasterized image isn’t happening for some reason.
What are you using to display SVG images in JGo? Have you written the code yourself? Does it depend on Batik?
Northwoods has a subclass of JGoImage called SVGImage that uses the Batik library and is currently in beta test. Did you get an advance copy of that? It currently examines the scale factor in the paint() method and caches the image at different resolutions using a WeakHashMap to achieve good performance without sacrificing too much memory. Changing scale factors with SVGImage seems to work well without creating the jagged lines you describe. You should contact Northwoods tech support if you would like access to the SVGImage beta test code.


#3

thanks for u’r reply.
The images that i have created depends on batik libraries. firstly i get the svg image, using svgrasterizer convert it into a buffered image with the new dimensions and then load it into the jgo area. previously , i did not get the new dimensions. i thought setscale() would increase the dimensions. now i changed the dimensions by multiplying with the scale factor. i was able to solve the problem (not fully),the image has got the jagged lines to a little extent and also i keep loosing some of lines in the image .