Private Bitmap Getdiskbitmap (String pathstring)
-
{  
-
bitmap bitmap = null ;  
-
try   
-
    {  
-
file file = new file (pathstring);
-
if (file.exists ())
{
Bitmap = Bitmapfactory.decodefile (pathstring);
-
        }  
-
} catch (exception e)
-
    {  
-
// todo: handle exception   
}
-
return  BITMAP;  
}
This method realizes to read a picture from the local path, can be JPG, BMP, PNG and so on many kinds of formats.
PathString is a local picture path such as: "Mnt/sdcard/1.jpg"
File File = new file (pathstring);
if (File.exists ())
{bitmap = Bitmapfactory.decodefile (pathstring);}
After reading to the local file, first determine if the file exists.
Bitmapfactory.decodefile (pathstring);
The local file can be decoded in a variety of image formats. Returns the Bitmap object
Android read local (SD card) picture