Android Bitmap Load returnBitMap(String path)

Here you can find the source of returnBitMap(String path)

Description

return Bit Map

License

Apache License

Declaration

public static Bitmap returnBitMap(String path) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Main {

    public static Bitmap returnBitMap(String path) throws IOException {
        URL url = null;//from w w w. ja  v a 2s.c o m
        Bitmap bitmap = null;
        url = new URL(path);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setDoInput(true);
        conn.connect();
        InputStream is = conn.getInputStream();
        bitmap = BitmapFactory.decodeStream(is);
        is.close();
        return bitmap;
    }
}

Related

  1. getBitmapFromInternet(String strName)
  2. getBitmapFromUri(Context ctxt, Uri selectedImageURI)
  3. getBitmapFromUrl(String url)
  4. loadBitmapFromFile(String fileNameWithPath)
  5. downloadBitmap(URI uri)
  6. getBitmapStoragePath(Context context)
  7. getTempBitmap(Context context)
  8. createBitmapFromImageFile(File imagefile)