Viewport Repositioning Problem When Zooming

Edited on 10/03/09
Hi Daniel,

I'm still working on my custom "eSlide viewer" and I still have a viewport repositioning problem when I go deeper in zoom, as I wrote in the last part of a previous post:

http://getsatisfaction.com/openzoom/t...

I'd like to submit this problem another time, so we could focus on it in order to obtain a solution.
I'm still developing using Adobe Flex Builder 3 and Openzoom SDK 0.4.2.1.
My goal is to handle big, rectangular images based on rectangular tiles. This is an important point in my work because I should handle pre-made images sets that have different zoom levels which are not exactly one half of the previous one (e.g. greater zoom - saying 40X - have 13x10 tiles, 20x have 7x5 tiles, 10x 4x3 tiles, 5x 2x2 tiles, 2.5x 1x1 tiles - it means that the second level of zoom has ceil(first level of zoom/2) tiles). The images' set is fully described in a RDF file called "caseInfo.RDF", inside images' set. My viewer points to this file in order to take all the properties needed by MultiscaleImage. The point of that kind of acquisition is flexibility (should work with every image) and efficiency (to minimize white - not useful - number of tiles). Everything seems to meet requirements of openzoom descriptor

http://gasi.ch/blog/openzoom-descript...

that's why I can't understand the behaviour that I'll post now.



This is the image that I obtain by clicking "load" button (after inserting set's descriptor). The MultiscaleImage is contained in a Canvas (in this case is a test one - 400x300 pixels). I don't know why the MultiscaleImage doesn't fill the canvas, any advice to solve this?



In this second image I clicked in the center of the blue canvas and I obtained this zoom that seems to be consistent, looking at the "image position" canvas (the red one in the preview).
Other little problem. This "image position" canvas seems to behave well, but hasn't the right image proportions (as you can see in the image, is quite square, not rectangular), probabily I have to fix something in transformWindow() function (I integrated SceneNavigator in the .mxml file)



This third image is obtained by clicking in the center of the blue canvas and here the problem is clear. As you can see the "image position" canvas (red one) and the part of MultiscaleImage shown, don't correspond anymore. This level of zoom is 10x, that means 4x3 tiles (the other two were 2.5x - 1x1 tiles and 5x - 2x2 tiles). I should say that when I clicked on previous image, the MultiscaleImage was "going deeper" in zoom in the right way and then the viewport was repositioned in the wrong way.
I can post another image that still shows the problem



Taking a look at openzoom library I found the following lines of code in ImagePyramidRenderManager.as (lines 260-263)

// FIXME: Currently center, calculate true origin
var t:Point = new Point(0.5, 0.5)
var origin:Point = new Point((1 - t.x) * fromTile.x + t.x * toTile.x,
(1 - t.y) * fromTile.y + t.y * toTile.y)

could this code be related with the viewport repositioning problem? I understand that this code re-sets the origin of the viewport on its center at every time/zoom level considered - am I right?

If you like to try my code, I posted my prototype on google code:

http://code.google.com/p/eslide-viewe...

In google code you can find also the images' set ("testTesi.zip" - in download section) of the images I posted.

Last question. Is there any working example of viewers fully based on openzoom descriptor?

Sorry for the length of this post, but I want to give as much details as I can, to make the problem clear.

Cheers,

David
 
silly I’m trying to make it work well
Inappropriate?
1 person has this problem

The company thinks this is not a problem.

See the changes made to this problem
User_default_medium