ImageRequest를 비동기로 실행하고 결과를 렌더링하는 AsyncImagePainter를 리턴합니다.
내부적으로 AsyncImage와 SubcomposeAsyncImage는 모델을 로드하기 위해 AsyncImagePainter를 사용합니다. 만약 Painter가 필요하고 AsyncImage를 사용할 수 없다면, rememberAsyncImagePainter를 사용해서 이미지를 로드할 수 있습니다.
rememberAsyncImagePainter(
ImageRequest
.Builder(LocalContext.current)
.data(data = thumbnailMovie.thumbUrl)
.apply {
crossfade(true)
scale(Scale.FILL)
}.build()
)
'Compose' 카테고리의 다른 글
[Compose] Compose 성능 최적화 방법 4가지 (0) | 2023.11.07 |
---|---|
[Compose] Compose Rendering (0) | 2023.11.07 |
[Compose] State Hoisting(상태 호이스팅)에 대하여 (0) | 2023.11.06 |
[Compose] Composable에서 MutableState 객체 생성하는 방법 (0) | 2023.11.03 |