Tag: 放大

将缩放添加到Android中的imageview

我想在我的Android应用中添加缩放function。 我试过这段代码,但它只是在图像中间放大和缩小,我想在整个图像上应用缩放。 在同一图像中,我可以在图像的某些区域放置一个按钮吗? import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.view.KeyEvent; import android.view.View; public class Zoom extends View { private Drawable image; private int zoomControler=20; public Zoom(Context context) { super(context); image=context.getResources().getDrawable(R.drawable.icon); setFocusable(true); } @Override protected void onDraw(Canvas canvas) { // TODO Auto-generated method stub super.onDraw(canvas); //Here you can control the width and height of the […]