android imageview scrolling to display full high quality image

前端 未结 2 981
醉梦人生
醉梦人生 2021-01-15 05:55

i am working on displaying an image and placing an icon on top of it... clicking the icon will show an enlarged version of the image...

though putting the imageview

2条回答
  •  悲&欢浪女
    2021-01-15 06:27

    developer.android.com/reference/android/graphics/Bitmap.html

    developer.android.com/reference/android/graphics/BitmapFactory.html

    refer this link.

    Bitmap mIcon1 = BitmapFactory.decodeResource(context.getResources(),R.drawable.twitter_icon);
    imgview.setImageBitmap(mIcon1);
    

    convert your image to bitmap and use. hope it works.....

    EDIT:

    URL img_value = new URL(string_url_input);
    if (profile != null) {
        Bitmap mIcon1 = BitmapFactory.decodeStream(img_value.openConnection().getInputStream());
        image_view.setImageBitmap(mIcon1);
    }
    

提交回复
热议问题