0

In the items of my app, they all contains a snapshot of the screen. When loading those items, I found the snapshot very blurry. It doesn't make sense since I didn't compress the image.

Then, I did a test. I obtained the saved image and display it directly on my screen. I found it clearer than the one displayed in the item which is loaded from the data base with coil. I don't know why.

Here is the code used to load the snapshot image in my UI

    val painter = rememberAsyncImagePainter(
        model = ImageRequest.Builder(LocalContext.current)
            .crossfade(true)
            .data(data)
            .build(),
        placeholder = painterResource(id = R.drawable.Loading),
        error = painterResource(id = R.drawable.Broken),
    )

    Image(
        painter = painter,
        contentDescription = null,
        contentScale = ContentScale.Crop,
        modifier = modifier
            .fillMaxSize()
            .clip(RoundedCornerShape(10.dp))
    )

Here is the one used to load the snapshot directly. I get the image from the folder of my app.

     Image(
         painter = painterResource(id = R.drawable.img_map_1681567346241),
         contentDescription = null,
         contentScale = ContentScale.Crop
     )

They are dispalyed at the same size on the same screen, but so different in clarity.

Ruineie
  • 23
  • 4

0 Answers0