본문 바로가기
  • 콩's 코딩노트
Android

Android Studio - 이미지 처리를 위한 Glide 사용법

by Cong_S 2022. 7. 20.

글라이드 라이브러리는 안드로이드에서 이미지를 불러오고 처리하기 위한 라이브러리이다.

간단하게 사용법을 알아보자.

 

먼저 build.gradle 파일에서 라이브러리를 설치해주자.

dependencies {

    // 이미지 처리를 위한 글라이드 라이브러리
    implementation 'com.github.bumptech.glide:glide:4.13.2'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
    
}

 

 

아래와 같이 데이터를 처리하는 클래스와 불러올 경로, 어디에 이미지를 표시할 지를 정해 사용할 수 있다.

Glide.with(context).load(video.imgUrl).into(holder.imgThumb);

 

https://github.com/bumptech/glide

 

GitHub - bumptech/glide: An image loading and caching library for Android focused on smooth scrolling

An image loading and caching library for Android focused on smooth scrolling - GitHub - bumptech/glide: An image loading and caching library for Android focused on smooth scrolling

github.com

 

댓글