I am using the Scrollable ImageView by Egor Andreevich found here.
Although I have successfully managed to insert this into my app, the issue I'm having is that my image is very laggy. The image I'm using is 1.63 mb and 3713x3329 in dimension. If I use a smaller image that is both small in dimension and size, then it works perfectly.
The post you are referring to seems to be an introduction of scrolling images in an ImageView, and not a complete implementation. I would direct you to PhotoView for a more complete implementation.
Related
I want to display set of images in horizontal viewpager.
I have used the "chrisbanes PhotoView" library.
Everything is working well but after zooming any image the quality of images getting lose even for high resolution images.
The Size of image is 1440*2560
Please let me know, if I am missing something
Thanks you in advanced
I am really trying to figure out which is the best way of loading a huge image in Android ImageView( or some other view extending ImageView).
I am aware of OOM issues with Android framework when working with bitmaps but still I need to implement the following requests:
horizontal scrollable imageview
must load a huge 8000px (keeping original image quality so no downsample) width and device height png image from drawble-nodpi in it and to be fluent while scrolling it without preloads or lag(recyclerview will have blinks so it is a no go I tried that)
I am thinking at a customview extending imageview and something to decode only current scrolled region from that bitmap but I am stuck here
avoid oom
also does a pdf viewer library be better than using huge png from performance point of view? I need the picture preloaded on app start not lazy loaded
I am working on an application which uses Google Firebase and RecyclerView. While retrieving the images from Firebease, images are not properly scaling up. When scrolling the recyclerview, sometimes images are showing as smaller ones and sometimes bigger. They are not scalling properly. I am using Glide to load the images. Please help me .
Also, is it a good idea to use Recuyclerview to use in complex application since OnbindViewHolder being called multiple times causing performance issues. Is there any alternative for that.
Please use this code:
Glide.with(profilePhotoImageView.getContext())
.load(profilePhotoUrl).centerCrop()
.transform(new CircleTransform(profilePhotoImageView.getContext()))
.override(40,40)
.into(profilePhotoImageView);
This means that you are setting a fixed width and height. In which profilePhotoUrl is the url of your image and profilePhotoImageView is the ImageView in which you want to display the image.
And don't forget to add the latest version of Glide in your build.gradle file.
'com.github.bumptech.glide:glide:4.0.0-RC1'
Hope it helps.
suppose that I have just one ImageView inside a HorizontalScrollView. The problem I'm facing is I have to create a very wide Bitmap to place it inside my ImageView and, obviously, use the scroll from HSV to see all my image there. I'm getting a lot of OutOfMemoryException so, is there any technique to get this task done without getting a ton of OutOfMemoryExceptions?
You are getting OutOfMemoeryException because your bitmap is too large to load the entire bitmap into memory (a loading issue not a rendering issue).
Instead you need a custom image view that downsamples and/or only loads sections of the image at a time depending upon what part of the image should be currently visible.
This may not fit your use case but it is an example of this problem being solved by downsampling
Assumes I have a picture, it very large images or other sets of content where you are only looking at small bits at a time, because you can start seeing your content without having to load it all into memory at once.
In iOs we can use CATiledLayer to repeatedly draw tiles to fill up view’s background
In Android I can see Google Map, It also load each part of map when you scroll but I don't understand what is solution of them.
I want know what is the solution same CATiledLayer in Android or other to load very large Image
you can actually scale down the bitmap according to the size of the image view.
Don't give wrap_content in width and height try to give a relative width and height.
use
ImageView.getheight()
ImageView.getWidth()
get the size and load according to it
see this link
http://developer.android.com/training/displaying-bitmaps/load-bitmap.html#read-bitmap
You can use a library load images efficiently and manage caching them instead of downloading them again. I suggest Picasso or Glide. This tutorial compares between them and explains few features.
I hope it's useful.