question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SVG extension Image does not work on ImageButton/Button

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
DeanFaizalcommented, May 27, 2022

@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

1reaction
mattleibowcommented, May 14, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found