我在google,stackoverflow上搜索了很多,...
我发现并尝试了所有这些:
Bitmap b = ((BitmapDrawable)imageView.getBackground()).getBitmap();
int w = b.getWidth();
int h = b.getHeight();
imageView.setDrawingCacheEnabled(true);
Bitmap b = imageView.getDrawingCache();
int w = b.getWidth();
int h = b.getHeight();
imageView.getWidth();
imageView.getHeight();
Drawable d = getResources().getDrawable(R.drawable.yourimage);
int h = d.getIntrinsicHeight();
int w = d.getIntrinsicWidth();
但每种方法都会产生相同的结果。我可以在横向模式和肖像模式下拍照。每次宽度为1024 且高度为768 但我等人像模式高度必须 1024 且宽度必须是768
请有人帮助我。