Android显示图片(非绑定)

<ImageView
        android:id="@+id/jpgview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
/> 

ImageView jpgView = (ImageView)findViewById(R.id.jpgview);
                  String myJpgPath = "/sdcard/DSC_0001.JPG"; 
                  BitmapFactory.Options options = new BitmapFactory.Options();
                  options.inSampleSize = 2;
                  Bitmap bm = BitmapFactory.decodeFile(myJpgPath, options);
                  jpgView.setImageBitmap(bm);

你可能感兴趣的:(android)