`

android 图片展示

阅读更多
public static void ShowPicture(String fileName, ImageView pic){

// Calling Convention
// ImageView pic=(ImageView)this.findViewById(R.id.picview);
// JBRoutines.ShowPicture(Constants.PICTURE_FILE,pic);

File f = new File(Environment.getExternalStorageDirectory(),fileName);
FileInputStream is = null;
try {
is = new FileInputStream(f);
} catch (FileNotFoundException e) {
Log.d(\"error: \",String.format( \"ShowPicture.java file[%s]Not Found\",fileName));
return;
}
Bitmap bm;
bm = BitmapFactory.decodeStream(is, null, null);
pic.setImageBitmap(bm);
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics