diff --git a/artwork/idea-logo.svg b/artwork/idea-logo.svg new file mode 100644 index 0000000000..07b1969104 --- /dev/null +++ b/artwork/idea-logo.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tutorials/Image_And_Icons_Manipulations/README.md b/tutorials/Image_And_Icons_Manipulations/README.md index e47704ba67..cbfe8c9195 100755 --- a/tutorials/Image_And_Icons_Manipulations/README.md +++ b/tutorials/Image_And_Icons_Manipulations/README.md @@ -337,6 +337,30 @@ fun asImageAsset(image: BufferedImage): ImageBitmap { ![Tray icon](tray_icon.png) +## Loading SVG images +Suppose we have an SVG image placed in the `resources/images` directory in our project. + +[SVG](../../artwork/idea-logo.svg) + +```kotlin +import androidx.compose.desktop.Window +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.svgResource + +fun main() { + Window { + Image( + painter = svgResource("images/idea-logo.svg"), + contentDescription = "Idea logo", + modifier = Modifier.fillMaxSize() + ) + } +} +``` +![Loading XML vector images](loading_svg_images.png) + ## Loading XML vector images Compose for Desktop supports XML vector images. XML vector images come from the world of [Android](https://developer.android.com/guide/topics/graphics/vector-drawable-resources). diff --git a/tutorials/Image_And_Icons_Manipulations/loading_svg_images.png b/tutorials/Image_And_Icons_Manipulations/loading_svg_images.png new file mode 100644 index 0000000000..b27c48b670 Binary files /dev/null and b/tutorials/Image_And_Icons_Manipulations/loading_svg_images.png differ