安卓:扩大上点击图片 [英] Android: Enlarging an image on click
本文介绍了安卓:扩大上点击图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想提出一个Android应用程序中,需要的是,当用户点击图像,我希望它在全屏幕打开。我如何做到这一点?
谁能帮我在这个?
谢谢
i am making an android app in which in need that , when the user clicks image I want it to open up in the full screen. How do I accomplish this? Can anyone help me over this? Thanks
推荐答案
获取所选图像的图片ID然后使用意图图片ID传递给FullImage活动。该活动使用ImageView的显示图像。
Get image Id of selected image then pass that image id to FullImage activity using Intent. Display image in that activity using ImageView.
遵循编码像这样
活动1 //其中图像可用。
Activity1 // where images are available..
Intent fullScreenIntent = new Intent(v.getContext(),Full.class);
fullScreenIntent.putExtra(Full.class.getName(),imageId);
在FullImage Activity..add这种编码。
in the FullImage Activity..add this coding.
int imageId1 = intent.getIntExtra(Full.class.getName(),default1);
InputStream is = this.getResources().openRawResource(imageId1);
Bitmap originalBitmap = BitmapFactory.decodeStream(is);
ImageView myimage = (ImageView) findViewById(R.id.ImageView01);
myimage.setImageBitmap(originalBitmap);
myimage.setScaleType(ScaleType.MATRIX);
这篇关于安卓:扩大上点击图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文