1. (BufferedInputStream,ByteArrayOutputStream,BufferedOutputStreamなどで)読み込んだbyte配列をBitmapFactory.decodeByteArray()にセットしてBitmapを得、ImageView.setImageBitmap()にセットすれば表示できる
2. InputStream in = httpResponse.getEntity().getContent() とし、 BitmapFactory.decodeStream(in) にセットすれば表示できる
- httpResponse = dhc.execute(new HttpGet(imageURL));
- if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
- httpEntity = httpResponse.getEntity();
- final InputStream in = httpEntity.getContent();
- Bitmap bitm = BitmapFactory.decodeStream(in);
- imageView.setImageBitmap(bitm);
- imageView.invalidate();
- }
0 件のコメント:
コメントを投稿