Android 如何应用缩放控制

Android 如何应用缩放控制,android,android-imageview,Android,Android Imageview,如何在图像视图中动态应用缩放控制?我的SDK最低版本是1.6。我尝试了大多数示例,但在所有这些示例中,ImageView中的图像设置为放大和缩小。我想放大和缩小图像视图。我想在放大时增加ImageView宽度和高度,在缩小时减少ImageView宽度和高度。有人能提出解决方案吗?是的,这是增加尺寸的代码 140 is the factor by which image is mulitplied maintaining the height to width ratio you can chan

如何在
图像视图中动态应用缩放控制?我的SDK最低版本是1.6。我尝试了大多数示例,但在所有这些示例中,
ImageView
中的图像设置为放大和缩小。我想放大和缩小
图像视图
。我想在放大时增加
ImageView
宽度和高度,在缩小时减少
ImageView
宽度和高度。有人能提出解决方案吗?

是的,这是增加尺寸的代码

140 is the factor by which image is mulitplied maintaining the height to width ratio
you can change this as you like


  Bitmap originalBitmap = BitmapFactory.decodeFile(IssueDataHandler.CONTENT_LOCAL_PATH+"/"+coverImageName.trim());
    Bitmap bitmap=originalBitmap;
    if (bitmap !=null) {
        int h = bitmap.getHeight();
        int w = bitmap.getWidth();
        h = 140*h/w;
        w = 140;
        bitmap = Bitmap.createScaledBitmap(bitmap, w, h, true);
        img.setImageBitmap(bitmap);
    }