我想知道如何放大图像或在单击时查看完整大小的图像。我想在屏幕上有四个小图像,这样当用户单击其中一个图像时,它会变得更大,这样他们就可以正确地看到图像。
我一直在寻找如何做到这一点,但没有找到任何东西。
如果你能帮助我,我将不胜感激。
谢谢您:)
发布于 2011-12-24 05:21:16
查看Hello Gallery教程,它将帮助您理解缩略图
http://developer.android.com/guide/tutorials/views/hello-gallery.html
发布于 2012-05-29 13:10:26
看看这个
使用缩略图的onClick方法,您可以在全屏模式下启动新活动:
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 Activity类中
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);https://stackoverflow.com/questions/8620698
复制相似问题