2014-02-22 7 views
0

안녕하세요 저는 Android를 처음 사용하고 도청되면 이미지를 확대하려고합니다. 문제는 내가 확대하려는 이미지가 데이터베이스에있는 것입니다 ... 도청 된 경우 원격 서버에서 검색된 이미지 확대 - Android

`package info.androidhive.slidingmenu; 
import java.io.InputStream; 
import android.app.Activity; 
import android.content.Intent; 
import android.graphics.Bitmap; 
import android.graphics.BitmapFactory; 
import android.os.AsyncTask; 
import android.os.Bundle; 
import android.util.Log; 
import android.widget.ImageView; 
import android.widget.TextView; 

public class LaboratoryResultInformation extends Activity { 

@Override 
protected void onCreate(Bundle savedInstanceState) { 
// TODO Auto-generated method stub 

super.onCreate(savedInstanceState); 
setContentView(R.layout.laboratoryresultinformation); 

Intent intent = getIntent(); 
Bundle extras = intent.getExtras(); 


//display image using passed url 
final String MY_URL_STRING = extras.getString("IMAGEURL_EXTRA"); 

new DownloadImageTask((ImageView) findViewById(R.id.labresultimage)) 
.execute(MY_URL_STRING); 
} 
private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> { 
ImageView bmImage; 

public DownloadImageTask(ImageView bmImage) { 
this.bmImage = bmImage; 

} 

protected Bitmap doInBackground(String... urls) { 
String urldisplay = urls[0]; 
Bitmap mIcon11 = null; 
try { 
InputStream in = new java.net.URL(urldisplay).openStream(); 
mIcon11 = BitmapFactory.decodeStream(in); 
} catch (Exception e) { 
Log.e("Error", e.getMessage()); 
e.printStackTrace(); 
} 
return mIcon11; 
} 

protected void onPostExecute(Bitmap result) { 
bmImage.setImageBitmap(result); 
} 
} 
}` 

내가 봤하지만 유일한 코드는 내가 이미지 자체가 이미있는 경우 /를에 저장 작품을 발견 .. 여기 내 XML 코드 ..

`<LinearLayout 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:layout_marginLeft="15dp" 
android:layout_weight="50" 
android:gravity="center" 
android:orientation="horizontal" > 

<ImageView 
android:id="@+id/labresultimage" 
android:layout_width="460dp" 
android:layout_height="320dp" 
android:src="@drawable/laboratory" /> 
</LinearLayout>` 

입니다 그리고 이것은 내 자바 코드 드로어 블 ..

답변