---
title: "Android显示图片(非绑定)"
author: "wangdf_jee"
date: "2012-04-09T11:35:49Z"
tags: []
categories: ["移动开发"]
slug: "android"
draft: false
lastmod: "2012-04-09T11:35:49Z"
id: 1480202
url: "https://wangdf-jee.iteye.com/blog/1480202"
---

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

```


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

```