View Single Post

Just a general question about the Scaling View classes.

I am implementing a general image canvas and currently use the framework's scaling views and scrollviews. What is the benefit of using those classes for just one non-tiled image?

The -adjustScaleTo:canvasSize: method reframes and retiles if needed but it affects the scrollview zoomScale. As a consequence and under 3.2SDK at least, my attached CAShapeLayers (they track my selection rectangles etc...) also need to be re-scaled manually. Normally, the Bezier paths in my image sublayers are automagically re-scaled by zoomScale so zooming via SDK pinch gestures works as expected with no programmatic intervention. Forcing a zoomScale to 1, as the method does by setting the transform to Identity also re-scales image sublayer content: a side effect that now requires some code to re-sync to a new "effective" scale. One simply has to add a rectangular shape layer to the image to demonstrate this.

The method does track memory usage and sets "safe" margins for min and max scales. And the framework does have built-in "snapZoom" functionality which is neat. Are there any other visual benefits like less pixelation ? I don't notice any with a 320x480 image on an iPad. The overhead of manually re-scaling sublayer content bothers me a little. Maybe I'm missing something.