Android 如何在单击图像时将其放大?
我想知道如何使图像变大,或者在单击图像时看到完整大小的图像。 我想在屏幕上有四个小图像,这样当用户点击其中一个图像时,它会变大,这样他们可以正确地看到图像 我一直在寻找如何做到这一点,但没有找到任何东西 如果你能帮助我,我将不胜感激Android 如何在单击图像时将其放大?,android,eclipse,image,click,scale,Android,Eclipse,Image,Click,Scale,我想知道如何使图像变大,或者在单击图像时看到完整大小的图像。 我想在屏幕上有四个小图像,这样当用户点击其中一个图像时,它会变大,这样他们可以正确地看到图像 我一直在寻找如何做到这一点,但没有找到任何东西 如果你能帮助我,我将不胜感激 谢谢:)查看Hello Gallery教程,它将帮助您理解缩略图 看看这个 单击缩略图的方法,您可以在全屏模式下启动新活动: getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, Windo
谢谢:)查看Hello Gallery教程,它将帮助您理解缩略图 看看这个
单击缩略图的
方法,您可以在全屏模式下启动新活动:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
并将图像uri或指示图像源的内容传递给新活动:
Intent intent = new Intent(YouActivity.this, FullImage.class);
intent.putExtra("imageUri", R.drawable.yourImage); // or the path to your image.
在FullImage活动类中
ImageView icon = (ImageView) findViewById(R.id.myImage);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inTempStorage = new byte[3*1024];
Bitmap ops = BitmapFactory.decodeFile(path, options);
// instead path you can get an image from previous activity.
icon.setImageBitmap(ops);
非常感谢。我试试看。看看网站,这正是我所需要的。:)