From d6e6cf5e0c6cff4b87c63ae7e8a38f5be1d72e87 Mon Sep 17 00:00:00 2001 From: akurasov <86794754+akurasov@users.noreply.github.com> Date: Thu, 10 Feb 2022 19:08:04 +0300 Subject: [PATCH] Documentation for #1016 --- .../Image_And_Icons_Manipulations/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tutorials/Image_And_Icons_Manipulations/README.md b/tutorials/Image_And_Icons_Manipulations/README.md index 8313224a97..653db7a3e0 100755 --- a/tutorials/Image_And_Icons_Manipulations/README.md +++ b/tutorials/Image_And_Icons_Manipulations/README.md @@ -260,6 +260,23 @@ fun main() = application { Window icon +In case of `singleWindowApplication` usage, you can use the following approach: + +```kotlin +import androidx.compose.material.Text +import androidx.compose.ui.graphics.painter.BitmapPainter +import androidx.compose.ui.res.loadImageBitmap +import androidx.compose.ui.res.useResource +import androidx.compose.ui.window.singleWindowApplication + +fun main() { + val icon = BitmapPainter(useResource("sample.png", ::loadImageBitmap)) + singleWindowApplication(icon = icon) { + Text("Hello World!") + } +} +``` + ## Setting the application tray icon You can create a tray icon for your application: