All Downloads are FREE. Search and download functionalities are using the official Maven repository.

desktopMain.org.jetbrains.compose.animatedimage.ResourceAnimatedImageLoader.kt Maven / Gradle / Ivy

There is a newer version: 1.8.0-alpha01
Show newest version
package org.jetbrains.compose.animatedimage

import androidx.compose.ui.res.useResource
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

internal class ResourceAnimatedImageLoader(private val resourcePath: String) : AnimatedImageLoader() {
    override suspend fun generateByteArray(): ByteArray = withContext(Dispatchers.IO) {
        return@withContext useResource(resourcePath) { it.readAllBytes() }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy