Context mContext;
ImageView mImage = (ImageView) findViewById(R.id.croppedImageView);
String imageUri = Item.getPhoto();
if (imageUri.equals("")) { // 이미지가 없을 때
int resourceId = R.drawable.photo_base;
Glide.with(mContext).load(resourceId).into(mImage);
} else { // 이미지가 있을 때
Glide.with(mContext).load(imageUri).into(mImage);
}
imageUri 는 실제 파일이 존재하는 경로, 예) http://www.abc.com/images/abc.jpg
폰의 폴더에 있는 이미지를 View 할 때
String croppedFolderName = "/DCIM/PhotoTemp"; File path = new File(Environment.getExternalStorageDirectory() + croppedFolderName); Bitmap photoBitmap = BitmapFactory.decodeFile(outputFile.getAbsolutePath() ); |
Glide 로 View 하면
String imageUri = outputFile.getAbsolutePath();
Glide.with(context).load(imageUri).into(imageView);
'안드로이드 > Android Image' 카테고리의 다른 글
Upload file with Retrofit2 (0) | 2020.09.20 |
---|---|
Image 다운로드 및 Glide View (0) | 2018.08.16 |
Android 이미지 로딩 라이브러리 Glide 사용 (0) | 2018.07.25 |
[안드로이드] 이미지 파일 다운로드 (0) | 2017.09.21 |
[안드로이드] 사진촬영 이미지 파일 서버 전송(PHP 서버 소스부분) (0) | 2017.09.19 |