解决方案 »

  1.   

    Bitmap可以得到高度和宽度,ImageView在内部才能获取,就是运行加载的时候。
      

  2.   

    怎样得取啊?代码:
    //转换成路径
    File file = new File(pathfile);
    Uri u = Uri.fromFile(file); // 初始化时显示第一张图片
    image.setImageURI(u);
    // 显示详细信息
    t1.setText(imglist.get(id) + "\t" + image.getHeight() + "×"
    + image.getWidth() + "\t" + new Timestamp(file.lastModified()));
    image.setFocusable(true);
    问:这里的 image.getHeight() 、 image.getWidth()得到的是0,图片显示了,
      

  3.   

    那地方获取不到的,你可以在ImageView的外层框架中获取到 组件的大小,是 view.getMeasureWidth()类似这样的。
      

  4.   


    BitmapFactory.Options options = new BitmapFactory.Options();
    BitmapFactory.decodeFile(file, options);
    int height = options.outHeight;
    int width = options.outWidth;