ShowPicture

1 vote · 0 comments

Simple routine to show an image file card in a view.

raw ·
copy
· download
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); }

Be the first to comment

Sign in with OpenID