In Jetpack compose example to load image from drawable folder we will use below code. In the above example we used image composable and create Painter object from painterResource() and pass the resource id. You can read more about Image composable in Jetpack compose
@Composable
fun LoadFromResourceDemo(){
val image: Painter = painterResource(id = R.drawable.image1)
Image(painter = image,contentDescription = "image",)
}
How To Set Text Color Programmatically Android TextView?
How to find Android Device UDID or unique ID?
Android Studio project R can't find
How to convert DP to Pixel and Pixel to Dp?
What is the Different Between val and var in Kotlin?
How to convert milli seconds to hours, minutes and seconds in Android?
What is NetworkOnMainThread Exception?
Invoke-customs are only supported starting with android 0 --min-api 26
What is Android?
What is Context?
What is ANR in android?
Open PDF in Google Drive with Intent in Android - RRutors
How to Generate signed apk with android studio
Add Jar/Library Files as Dependency in Android Studio
How to install/ uninstall apk by command line ADB
How to Get bitmap from drawable: Android
How to check Android version?
Set Activity to Fullscreen Mode in Android - RRutors
How to avoid multiple button click at same time in android?
What is Application?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
How can i comment inside xml file in android studio?
How to get complete address from latitude and longitude?
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
How do I check in SQLite whether a table exists?
Hide/Disable soft keyboard on Activity launch: Android
How to Use Deprecated Handler() in Android - RRutors Guide
Explain Fragment Life Cycle
Symmetric vs Asymmetric Encryption in Android Server - RRutors
Check List for Generate Signed APK Android
How to start a new activity on button click
Fix Duplicate Files in APK Build.gradle Issue - RRutors
Extract Date and Time from Long Type Variable - RRutors
How to get an image resource by it's name in android?
How do i load image from drawable folder in Jetpack Compose?
How to reduce APK package size?
What is ANR? How to avoid and resolve it?
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
Decompile APK Files: How to Get Source Code - RRutors Guide
How to get screen size (width,height) in Android?