Closed wangvsa closed 10 years ago
if shouldScaleToFit is set to true, can i get the minimum value of scale?
Hi @wangvsa , glad you find the widget useful.
Is there a method like zoomin or zoomout?
I think you're looking for TileView.setScale
.
if shouldScaleToFit is set to true, can i get the minimum value of scale?
Not sure why, but I didn't provide getters for min or max scales, and the members are private. It wouldn't be a big deal to add those methods, and I can so so with the next commit if that'd be helpful. shouldScaleToFit
just flags whether the tiled image should ever show empty space or not ("true" means do not show empty space).
@moagrius thank you again
How can i get the position of the center point? Because I want to scale the image without moving its center.
public void zoomin() {
tileView.scale(tileView.getScale()+0.25);
tileView.moveToAndCenter(originCenter.x, originCenter.y)
}
Normal view methods can be used to maintain scroll position, but it can be kind of a hassle. getScrollX/Y() gives the scroll position, which you can then offset by half of getWidth/Height().
smoothScaleTo
does this automatically.
ZoomPanLayout handles most of this kind of thing internally, but you can get some hints. Try the maintainScrollDuringPinchOperation and maintainScrollDuringScaleTween methods.
@moagrius Thanks for the clear explanation! I'll check it out soon.
HTH, GL
Hi @moagrius , thank you very much for providing a such excellent widget.
Is there a method like zoomin or zoomout? I thought it might be handy to use but i could not find one.