是否有一种常见的方法来显示大图像并使用户能够放大和缩小图像?
到现在为止我找到了两种方法:
如何设置捏拉变焦的最大和最小缩放级别?
这是我的代码://
public class TouchImageView extends ImageView {
private static final String TAG = "Touch";
// These matrices will be used to move and zoom image
Matrix matrix = new Matrix();
Matrix savedMatrix = new Matrix();
static PinchZoomExample sPinchZoomExample = null;
// We can be in one of these 3 states
static final int NONE = 0;
static final int DRAG = 1;
static final int ZOOM = 2;
int mode = NONE;
static Bitmap sCurrentImage;
// Remember some things …Run Code Online (Sandbox Code Playgroud)