10-25-2012 08:51 AM
I'm trying to implement a long list of images in a listview (essentially a custom image picker). The issue is that the images themselves are quite large so for memory management I load the image, scaled them down using Qimage and then present it to then using attached ImageSCaler. Here's a sample of the code:
ImageView {
id:imageviewID
}
attachedObjects: [
ImageScaler {
id: loader
imageSource: ListItemData.thumbURL
onImageChanged: {
imageviewID.image = loader.image
}
}]
}
My sample gallery has 50 images. My issue is that as the listview scrolls along it clears the cache off screen and then it lags reloading the images once you scroll back. Since I've scaled the images down, I don't expect it will occupy too much memory and I'd like to just leave the images in cache, instead of reloading. Does anyone have any suggestions how I can implment this?
I've reviewed this sample but it seems to load small files and I need to some how rescale them.
ttps://developer.blackberry.com/cascades/documenta
Does anyone have any suggestions how can I implement this?
10-27-2012 12:16 AM
Any help about listview would be greatly appreciated as I've struggled with this topic for over a month now. I've identified that the issue is that even if I do something like:
Imageview{
imageSource: ListItemData.URL
}
This listitemdata changes as it scrolls off the screen as listviews appear to reindex themselves, forcing an onImageSourceChanged. I can't find any details about how listviews index. How can I get the Imageview so that caches and then pulls from an index cache instead of reloading by executing an onImageSourceChanged?
10-27-2012 12:52 AM
10-27-2012 01:39 AM
Thank you.
That example overwrites the entire data(indexPath) function. For listitemdata, does that actually call the data(IndexPath) method? So is the method then to modify the data(IndexPath) by inserting the contingouscached image in the returned QVariant(QvariantMap) and then just return the rest of the QVariant @ index Path?
10-27-2012 02:06 AM