maui: SVG extension Image does not work on ImageButton/Button

Description

When I created a ImageButton or Button, set Source/ImageSource property with a svg extension like below:

<Button ImageSource="button.svg"/>

The button would show nothing. But it works on MacOS

Steps to Reproduce

  1. Create a maui project
  2. Add ImageButton or Button
  3. Set Source or ImageSource with a svg extension image

Version with bug

Release Candidate 2

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows 10

Did you find any workaround?

No response

Relevant log output

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 17 (6 by maintainers)

Most upvoted comments

@AllenMiaoFil would you mind opening a new feature request for adding an ImageOpacity property to ImageButton?

https://github.com/dotnet/maui/issues/new?assignees=&labels=proposal%2Fopen%2Ct%2Fenhancement&template=feature-request.yml

we want to use svg opacity

I am not sure what you mean by this? When the svg is converted to a png, the values in the svg are used on a transparent image.

Also, the svg is just a build input and never reaches the final app.