Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to set ImageSize with displayImage ()?

I have a question regarding the https://github.com/nostra13/Android-Universal-Image-Loader library.

I'm using imageLoader.displayImage(...) to load images from my database to imageviews, that are in a listview.

The docs say this:

ImageSize targetSize = new ImageSize(120, 80); // result Bitmap will be fit to this size
imageLoader.loadImage(imageUri, targetSize, displayOptions, new SimpleImageLoadingListener() {
    @Override
    public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
        // Do whatever you want with Bitmap
    }
});

Would it be possible to declare a target size for the imageLoader.displayImage method?

like image 257
Tamas Avatar asked Oct 21 '22 04:10

Tamas


1 Answers

You can use method: public void loadImage(String uri, ImageSize targetImageSize, DisplayImageOptions options, ImageLoadingListener listener) to set a ImageSize parameter.

The downloaded image will be decoded and scaled to Bitmap of the size which is equal or larger (usually a bit larger) than incoming targetImageSize.

like image 91
codezjx Avatar answered Nov 02 '22 04:11

codezjx