ITeye博客

Android显示图片(非绑定)

wangdf_jee · 2012-04-09 11:35 · Android · 移动开发 · Markdown


<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);

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。