SVG extension Image does not work on ImageButton/Button
See original GitHub issueDescription
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
- Create a maui project
- Add ImageButton or Button
- 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
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:17 (6 by maintainers)
Top Results From Across the Web
svg images not displayed on Windows platform
I'm trying to set some svg images on ImageButton controls in a Maui project. I noticed that they are displayed correctly on Android...
Read more >Image button & SVG error - The Projucer
SVG file, it only works as Drawable, not with ImageButton (although Jucer seems to suggest it should work). I guess some glue is...
Read more >SVG image not being accepted in the Media Library ...
Go to the Media type image. · Edit the image field. · Add svg as a allowed format and save. · Go to...
Read more >Add multi-density vector graphics | Android Studio
Android Studio includes a tool called Vector Asset Studio that helps you add material icons and import Scalable Vector Graphic (SVG) and ...
Read more >Images in .svg format no longer supported
It sounds like there is a security issue with .SVG files so they are likely not going to be supported in the future....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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
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.