Android: Display Image from Sd Card

Android: Display Image from SD CARD

I would rather use a BitmapFactory to decode the Image from the file-path:

Bitmap bitmap = BitmapFactory.decodeFile(imageFile.getAbsolutePath());
jpgView.setImageBitmap(bitmap);

The Docs say:

If the specified file name is null, or cannot be decoded into a
bitmap, the function returns null.

Can you check if the code works with another image and if you can open your image on your PC thought. Maybe the file is corrupt.

Set Imageview to show image in sdcard?

Bitmap bmp = BitmapFactory.decodeFile(pathName);
ImageView img;
img.setImageBitmap(bmp);

Hope this helps.

How to get the image from sd card and show in gridView

I think you should try..

Picasso.with(activity)
.load(new File("/storage/emulated/0/Pictures/Project/IMG_20151013_181311id_5.jpg"))
.transform(new CircleTransform()).resize(100, 100)
.error(R.drawable.icon_no_preview).into(holder.photo_imageView);

Displaying images from SD Card using Fresco library on android

Check out:

https://dzone.com/articles/displaying-images-sd-card

http://frescolib.org/docs/supported-uris.html#_

Here loading images from sd card is explained in first link and how to connect it with fresco is explained in second link.

How to display an image from SD card on Android canvas?

in your :

        void draw(Canvas c) {
c.save();
c.drawColor(0xff000000);
doDraw(c); //method to call to set the image
}

public void doDraw(Canvas c) {

Resources res = getResources();
Bitmap bm = BitmapFactory.decodeResource(res, R.drawable.yourimage);
c.drawBitmap(bm, 0, 0, null);
}


Related Topics



Leave a reply



Submit