ছবি লোড হচ্ছে
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
ডিস্ক থেকে একটি ছবি লোড করুন
স্ক্রিনে একটি গ্রাফিক প্রদর্শন করতে Image
কম্পোজযোগ্য ব্যবহার করুন। ডিস্ক থেকে একটি ছবি (উদাহরণস্বরূপ: PNG, JPEG, WEBP) বা ভেক্টর রিসোর্স লোড করতে, আপনার ছবির রেফারেন্স সহ painterResource
এপিআই ব্যবহার করুন। আপনার সম্পদের ধরন জানার দরকার নেই, শুধু Image
বা paint
মডিফায়ারে painterResource
ব্যবহার করুন।
DrawScope
:
Image(
painter = painterResource(id = R.drawable.dog),
contentDescription = stringResource(id = R.string.dog_content_description)
)
আপনার অ্যাপ অ্যাক্সেসযোগ্য তা নিশ্চিত করতে, স্ক্রিনে ভিজ্যুয়াল উপাদানগুলির জন্য একটি contentDescription
সরবরাহ করুন৷ টকব্যাক বিষয়বস্তুর বিবরণ পড়ে, তাই আপনাকে অবশ্যই নিশ্চিত করতে হবে যে উচ্চস্বরে পড়া এবং অনুবাদ করা হলে পাঠ্যটি অর্থপূর্ণ। উপরের উদাহরণে, একটি stringResource()
strings.xml
ফাইল থেকে অনূদিত বিষয়বস্তুর বিবরণ লোড করতে ব্যবহৃত হয়। যদি স্ক্রিনে আপনার ভিজ্যুয়াল উপাদানটি শুধুমাত্র ভিজ্যুয়াল ডেকোরেশনের জন্য হয়, তাহলে স্ক্রীন রিডার যাতে উপেক্ষা করতে পারে তার জন্য আপনার contentDescription
null
সেট করুন।
আপনার যদি নিম্ন-স্তরের ImageBitmap
নির্দিষ্ট কার্যকারিতার প্রয়োজন হয়, আপনি একটি বিটম্যাপ লোড করতে ImageBitmap.imageResource()
ব্যবহার করতে পারেন। ImageBitmaps সম্পর্কে আরও তথ্যের জন্য, ImageBitmap বনাম ImageVector বিভাগটি পড়ুন।
অঙ্কনযোগ্য সমর্থন
painterResource
বর্তমানে নিম্নলিখিত অঙ্কনযোগ্য প্রকারগুলিকে সমর্থন করে:
ইন্টারনেট থেকে একটি ছবি লোড করুন
ইন্টারনেট থেকে একটি ছবি লোড করতে, প্রক্রিয়াটি পরিচালনা করতে আপনাকে সাহায্য করার জন্য বেশ কয়েকটি তৃতীয় পক্ষের লাইব্রেরি উপলব্ধ রয়েছে। ইমেজ লোডিং লাইব্রেরি আপনার জন্য অনেক ভারী কাজ করে; তারা ছবি ডাউনলোড করতে এবং পর্দায় প্রদর্শন করার জন্য ক্যাশিং (যাতে আপনি ছবিটি একাধিকবার ডাউনলোড করবেন না) এবং নেটওয়ার্কিং লজিক উভয়ই পরিচালনা করে।
উদাহরণস্বরূপ, Instacart থেকে কয়েল সহ একটি চিত্র লোড করতে, আপনার গ্রেডল ফাইলে লাইব্রেরি যুক্ত করুন এবং একটি URL থেকে একটি চিত্র লোড করতে একটি AsyncImage
ব্যবহার করুন:
AsyncImage(
model = "https://example.com/image.jpg",
contentDescription = "Translated description of what the image contains"
)
অতিরিক্ত সম্পদ
{% শব্দার্থে %}
{% endverbatim %} আপনার জন্য প্রস্তাবিত
{% শব্দার্থে %} {% endverbatim %}
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-28 UTC-তে শেষবার আপডেট করা হয়েছে।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-08-28 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["Load an image from the disk\n\nUse the [`Image`](/reference/kotlin/androidx/compose/foundation/package-summary#Image) composable to display a graphic on screen. To load an image\n(for example: PNG, JPEG, WEBP) or vector resource from the disk, use the\n[`painterResource`](/develop/ui/compose/quick-guides/content/load-images?hl=en) API with your image reference. You don't need to know the type\nof the asset, just use `painterResource` in `Image` or `paint` modifiers.\n\n`DrawScope`:\n\n\n```kotlin\nImage(\n painter = painterResource(id = R.drawable.dog),\n contentDescription = stringResource(id = R.string.dog_content_description)\n)https://github.com/android/snippets/blob/dd30aee903e8c247786c064faab1a9ca8d10b46e/compose/snippets/src/main/java/com/example/compose/snippets/images/LoadingImagesSnippets.kt#L49-L52\n```\n\n\u003cbr /\u003e\n\nTo ensure that your app is [accessible](/develop/ui/compose/accessibility), supply a `contentDescription` for\nvisual elements on screen. TalkBack reads out the content description, so you\nmust ensure that the text is meaningful if read out loud and translated. In the\nabove example, a `stringResource()` is used to load up the translated content\ndescription from the `strings.xml` file. If your visual element on screen is\npurely for visual decoration, set your `contentDescription` to `null` for the\nscreen reader to ignore it.\n\nIf you need lower-level `ImageBitmap` specific functionality, you can use\n`ImageBitmap.imageResource()` to load up a Bitmap. For more information on\nImageBitmaps, read the [ImageBitmap versus ImageVector](/develop/ui/compose/graphics/images/compare) section.\n\nDrawable support\n\n`painterResource` currently supports the following drawable types:\n\n- [`AnimatedVectorDrawable`](/reference/android/graphics/drawable/AnimatedVectorDrawable)\n- [`BitmapDrawable`](/reference/android/graphics/drawable/BitmapDrawable) (PNG, JPG, WEBP)\n- [`ColorDrawable`](/reference/android/graphics/drawable/ColorDrawable)\n- [`VectorDrawable`](/reference/android/graphics/drawable/VectorDrawable)\n\nLoad an image from the internet\n\nTo load an image from the internet, there are several third-party libraries\navailable to help you handle the process. Image loading libraries do a lot of\nthe heavy lifting for you; they handle both caching (so you don't download the\nimage multiple times) and networking logic to download the image and display it\non screen.\n\nFor example, to load an image with [Coil](https://github.com/coil-kt/coil#jetpack-compose)\nfrom Instacart, add the library to your gradle file, and use an `AsyncImage` to load an image from a URL:\n\n\n```kotlin\nAsyncImage(\n model = \"https://example.com/image.jpg\",\n contentDescription = \"Translated description of what the image contains\"\n)https://github.com/android/snippets/blob/dd30aee903e8c247786c064faab1a9ca8d10b46e/compose/snippets/src/main/java/com/example/compose/snippets/images/LoadingImagesSnippets.kt#L60-L63\n```\n\n\u003cbr /\u003e\n\n[Coil](https://github.com/coil-kt/coil#jetpack-compose)\n\nAn image loading library backed by Kotlin Coroutines (Instacart). \n[](https://search.maven.org/artifact/io.coil-kt/coil-compose \"Maven version of the library\") \n[Glide](https://bumptech.github.io/glide/int/compose.html)\n\nA fast and efficient image loading library for Android focused on smooth scrolling (Google). \n[](https://search.maven.org/artifact/com.github.bumptech.glide/compose \"Maven version of the library\")\n\nAdditional resources\n\n- [Load and display images](/develop/ui/compose/quick-guides/content/load-images?hl=en)\n\nRecommended for you\n\n- Note: link text is displayed when JavaScript is off\n- [Resources in Compose](/develop/ui/compose/resources)\n- [Accessibility in Compose](/develop/ui/compose/accessibility)\n- [Graphics in Compose](/develop/ui/compose/graphics/draw/overview)"]]